pypubfigs is a Python package for creating publication-ready figures with colorblind-friendly palettes and themes for matplotlib/seaborn.
If you found pypubfigs helpful, please cite: ggpubfigs: Colorblind-Friendly Color Palettes and ggplot2 Graphic System Extensions for Publication-Quality Scientific Figures. DOI: 10.1128/MRA.00871-21
Guide
Install
Quick Start
Color Palettes
Table of Hex Codes
Themes
FAQ
Change Log
Versioning
Acknowledgements
Install
pip install pypubfigs
Quick Start
These quick-start examples demonstrate theme and palette usage.
import seaborn as sns
import matplotlib.pyplot as plt
from pypubfigs import friendly_pal, theme_big_simple
# Apply theme and palette
theme_big_simple()
sns.set_palette(friendly_pal("ito_seven"))
# Plot
tips = sns.load_dataset("tips")
sns.barplot(x="day", y="total_bill", hue="sex", data=tips)
plt.show()
import matplotlib.pyplot as plt
from pypubfigs import friendly_pal, theme_big_grid
theme_big_grid()
palette = friendly_pal("bright_seven")
x = [1, 2, 3, 4]
y1 = [10, 20, 25, 30]
y2 = [30, 23, 15, 5]
plt.bar(x, y1, color=palette[0], label="Group 1")
plt.bar(x, y2, bottom=y1, color=palette[1], label="Group 2")
plt.legend()
plt.show()
Color Palettes
All palettes are colorblind-friendly.
from pypubfigs import friendly_pal
# Discrete
friendly_pal("contrast_three")
# Continuous
friendly_pal("contrast_three", n=50, type="continuous")
Table of Hex Codes
| Palettes | Colors used |
|---|---|
| bright_seven | #4477AA, #228833, #AA3377, #BBBBBB, #66CCEE, #CCBB44, #EE6677 |
| contrast_three | #004488, #BB5566, #DDAA33 |
| vibrant_seven | #0077BB, #EE7733, #33BBEE, #CC3311, #009988, #EE3377, #BBBBBB |
| muted_nine | #332288, #117733, #CC6677, #88CCEE, #999933, #882255, #44AA99, #DDCC77, #AA4499 |
| nickel_five | #648FFF, #FE6100, #785EF0, #FFB000, #DC267F |
| ito_seven | #0072B2, #D55E00, #009E73, #CC79A7, #56B4E9, #E69F00, #F0E442 |
| ibm_five | #648FFF, #785EF0, #DC267F, #FE6100, #FFB000 |
| wong_eight | #E69F00, #56B4E9, #009E73, #F0E442, #0072B2, #D55E00, #CC79A7, #000000 |
| tol_eight | #332288, #117733, #44AA99, #88CCEE, #DDCC77, #CC6677, #AA4499, #882255 |
| zesty_four | #F5793A, #A95AA1, #85C0F9, #0F2080 |
| retro_four | #601A4A, #EE442F, #63ACBE, #F9F4EC |
| tableau_ten | #4E79A7, #F28E2B, #E15759, #76B7B2, #59A14F, #EDC948, #B07AA1, #FF9DA7, #9C755F, #BAB0AC |
| glasbey_twelve | #0000FF, #FF0000, #00FF00, #000033, #FF00B6, #005300, #FFD300, #009FFF, #9A4D42, #00FFBE, #783FC1, #1F9698 |
| viridis_eight | #440154, #46337E, #365C8D, #277F8E, #1FA187, #4AC16D, #9FDA3A, #FDE725 |
| cividis_eight | #00204D, #16396D, #4B546C, #6C6E72, #8E8A79, #B3A772, #DBC761, #FFEA46 |
Themes
Publication-ready themes
theme_simple()theme_big_simple()theme_grid()theme_big_grid()theme_grey()
Presentation-ready themes
theme_black()theme_blue()theme_red()
import seaborn as sns
import matplotlib.pyplot as plt
from pypubfigs import friendly_pal, theme_black
theme_black()
sns.set_palette(friendly_pal("bright_seven"))
tips = sns.load_dataset("tips")
sns.scatterplot(data=tips, x="total_bill", y="tip", hue="day")
plt.title("Seaborn example with theme_black()")
plt.show()
FAQ
Can I submit color palettes or themes to be incorporated into pypubfigs?
Yes. Submissions are encouraged. Please reach out via Bluesky or contact information.
Change Log
1.1.3 (2026-02-24)
- Added new palettes:
tableau_ten,glasbey_twelve,viridis_eight, andcividis_eight. - Updated README palette table and usage examples.
- Added tests for palette and theme behavior.
1.1.2
- Strengthened theme/grid behavior consistency.
- Expanded automated tests.
1.1.1 and earlier
- Initial release series for Python parity with ggpubfigs themes and palettes.
Acknowledgements
- This package is the Python counterpart of ggpubfigs.
- Palette and theme design are based on the original ggpubfigs publication and implementation.
Metadata
Release files for pypubfigs 1.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pypubfigs-1.1.3.tar.gz | 7.4 kB | Without provenance | Details for pypubfigs-1.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pypubfigs-1.1.3-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for pypubfigs-1.1.3-py2.py3-none-any.whl |
Total release size: 14.1 kB
Release files / pypubfigs-1.1.3.tar.gz
| Download URL | pypubfigs-1.1.3.tar.gz |
|---|---|
| Size | 7.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3ad2f3c6ead872a0bea780492d23901f49b9d760b49037b4353af918f2725896
|
|
BLAKE2b-256 checksum How to use checksums |
172c53c762863f6d0dd510fed53b32d9121b53755b1b98788e22311ea13ff1b6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.10
|
Release files / pypubfigs-1.1.3-py2.py3-none-any.whl
| Download URL | pypubfigs-1.1.3-py2.py3-none-any.whl |
|---|---|
| Size | 6.7 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
7ab7453a3033052ecc14588e04c3609cb12c54f775cbe9d3a6032813eb3be661
|
|
BLAKE2b-256 checksum How to use checksums |
c06e1c0d5239c66bf3988a48c056a17e3dd4b41a6840c29865d8d6480ad01dac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.10
|
Security for pypubfigs 1.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.