Beautiful color and plotting utilities using matplotlib & plotly
Project description
Beautiful color and plotting utilities for matplotlib and plotly.
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.
Links
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3b71d606fb37e1a423a85a1c178bcd9b8918a0b92bafeca13238516989b57d43
|
|
| MD5 |
09702e8f540e72b7c73db057982e673c
|
|
| BLAKE2b-256 |
5724831ebed1c1f2da496762037f6b60200726b7bae0212a174602afb1b39680
|
Provenance
The following attestation bundles were made for plotfair-0.1.0.tar.gz:
Publisher:
publish.yml on barton-muller/plotfair
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
plotfair-0.1.0.tar.gz -
Subject digest:
3b71d606fb37e1a423a85a1c178bcd9b8918a0b92bafeca13238516989b57d43 - Sigstore transparency entry: 889439216
- Sigstore integration time:
-
Permalink:
barton-muller/plotfair@160fa3159509ff380c2f0acdc3dc23e363314556 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/barton-muller
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@160fa3159509ff380c2f0acdc3dc23e363314556 -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
486dab5a9a504e649804df93d12ec90de16d014910972edba6373f2679b2ffe2
|
|
| MD5 |
daad689dd5fc3a51c0590deabacb6d6e
|
|
| BLAKE2b-256 |
bd49289a2c22272f4eb51aaa0637110e1f0c539e9dcdad4e67ec44f86d8867ed
|
Provenance
The following attestation bundles were made for plotfair-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on barton-muller/plotfair
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
plotfair-0.1.0-py3-none-any.whl -
Subject digest:
486dab5a9a504e649804df93d12ec90de16d014910972edba6373f2679b2ffe2 - Sigstore transparency entry: 889439275
- Sigstore integration time:
-
Permalink:
barton-muller/plotfair@160fa3159509ff380c2f0acdc3dc23e363314556 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/barton-muller
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@160fa3159509ff380c2f0acdc3dc23e363314556 -
Trigger Event:
release
-
Statement type: