Skip to main content

Beautiful color and plotting utilities using matplotlib & plotly

Project description

Beautiful color and plotting utilities for matplotlib and plotly.

PyPI version Python versions Documentation Status License

plotfair provides curated color palettes, perceptually uniform colormaps, and convenient wrappers to create publication-quality figures with consistent styling across matplotlib, plotly, and interplot backends.

Features

  • PaintKit Color System - Curated color swatches with filtering by saturation (bright, dark, muted) and color family. Includes the Flexoki color scheme.

  • Perceptual Colormaps - Create colormaps that are perceptually uniform using CIECAM02 color space, ensuring smooth gradients for data visualization.

  • Matplotlib Presets - Publication-ready defaults with enhanced DPI, clean styling, and automatic figure saving to organized folders.

  • Plotly Wrapper - Matplotlib-like interface for Plotly via the Plty class.

  • Interplot Integration - Pre-configured settings for interplot with matplotlib-style plotting via the Iplt class.

Installation

pip install plotfair

Quick Start

import plotfair as pf
import matplotlib as mpl

# Set a color scheme
scheme = pf.paintkit.filter(tags={'dark'}).ordered_swatches(pf.full_rainbow)
mpl.rcParams['axes.prop_cycle'] = scheme.to_cycler()

# Create a perceptual colormap
colors = [s.hex for s in pf.paintkit.ordered_swatches(['blue', 'pink', 'orange']).colors]
cmap = pf.colormaps.perceptual_colormap_nonuniform(colors, [0.0, 0.5, 1.0])
pf.show_colormap(cmap, name='Custom Colormap')

Color Schemes

Filter colors by saturation (bright, dark, muted) or color family:

bright = pf.paintkit.filter(tags={'bright'})
blues = pf.paintkit.filter(tags={'blue'})
flexoki = pf.paintkit.filter(tags={'flexoki'})

Use predefined orderings:

# Available: pf.rainbow, pf.full_rainbow, pf.tab10, pf.flexoki
scheme = pf.paintkit.filter(tags={'bright'}).ordered_swatches(pf.tab10)

Plotly Wrapper

from plotfair import Plty
import numpy as np

plty = Plty()
x = np.linspace(0, 10, 100)

plty.plot(x, np.sin(x), label='sin(x)')
plty.xlabel('x')
plty.ylabel('y')
plty.show()

Documentation

Full documentation is available at plotfair.readthedocs.io.

Requirements

  • Python 3.9+

  • matplotlib

  • numpy

  • colorspacious

  • plotly >= 6.5.2

  • interplot >= 1.1.1

License

MIT License. See LICENSE for details.

Flexoki color scheme © Stephen Ango, licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

plotfair-0.1.0.tar.gz (16.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

plotfair-0.1.0-py3-none-any.whl (19.7 kB view details)

Uploaded Python 3

File details

Details for the file plotfair-0.1.0.tar.gz.

File metadata

  • Download URL: plotfair-0.1.0.tar.gz
  • Upload date:
  • Size: 16.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for plotfair-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3b71d606fb37e1a423a85a1c178bcd9b8918a0b92bafeca13238516989b57d43
MD5 09702e8f540e72b7c73db057982e673c
BLAKE2b-256 5724831ebed1c1f2da496762037f6b60200726b7bae0212a174602afb1b39680

See more details on using hashes here.

Provenance

The following attestation bundles were made for plotfair-0.1.0.tar.gz:

Publisher: publish.yml on barton-muller/plotfair

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file plotfair-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: plotfair-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 19.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for plotfair-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 486dab5a9a504e649804df93d12ec90de16d014910972edba6373f2679b2ffe2
MD5 daad689dd5fc3a51c0590deabacb6d6e
BLAKE2b-256 bd49289a2c22272f4eb51aaa0637110e1f0c539e9dcdad4e67ec44f86d8867ed

See more details on using hashes here.

Provenance

The following attestation bundles were made for plotfair-0.1.0-py3-none-any.whl:

Publisher: publish.yml on barton-muller/plotfair

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page