Metadata-Version: 2.4
Name: pypubfigs
Version: 1.1.3
Summary: Colorblind-friendly color palettes and themes for publication-quality scientific figures using matplotlib and seaborn.
Home-page: https://github.com/jlsteenwyk/pypubfigs
Author: Jacob L. Steenwyk
Author-email: jlsteenwyk@gmail.com
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE.md
Requires-Dist: seaborn>=0.12.2
Requires-Dist: matplotlib>=3.7.0
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

<p align="center">
    <img src="https://raw.githubusercontent.com/JLSteenwyk/pypubfigs/refs/heads/main/pypubfigs_logo.png" alt="Logo" width="400">
    <p align="center">
        <a href="https://github.com/jlsteenwyk/pypubfigs/graphs/contributors" alt="Contributors">
            <img src="https://img.shields.io/github/contributors/jlsteenwyk/pypubfigs">
        </a>
        <a href="https://bsky.app/profile/jlsteenwyk.bsky.social" target="_blank" rel="noopener noreferrer">
          <img src="https://img.shields.io/badge/Bluesky-0285FF?logo=bluesky&logoColor=fff">
        </a>
        <br />
        <a href="https://lbesson.mit-license.org/" alt="License">
            <img src="https://img.shields.io/badge/License-MIT-blue.svg">
        </a>
        <a href="https://journals.asm.org/doi/10.1128/MRA.00871-21">
          <img src="https://zenodo.org/badge/DOI/10.1128/MRA.00871-21.svg">
        </a>
    </p>
</p>

**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](https://jlsteenwyk.com/publication_pdfs/2021_Steenwyk_and_Rokas_Microbiology_Resource_Announcements.pdf)

---

## Guide
[Install](#install)<br />
[Quick Start](#quick-start)<br />
[Color Palettes](#color-palettes)<br />
[Table of Hex Codes](#table-of-hex-codes)<br />
[Themes](#themes)<br />
[FAQ](#faq)<br />
[Change Log](#change-log)<br />
[Versioning](VERSIONING.md)<br />
[Acknowledgements](#acknowledgements)

---

## Install
```bash
pip install pypubfigs
```

---

## Quick Start
These quick-start examples demonstrate theme and palette usage.

```python
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()
```

```python
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.

```python
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()`

```python
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?**<br />
Yes. Submissions are encouraged. Please reach out via [Bluesky](https://bsky.app/profile/jlsteenwyk.bsky.social) or [contact information](https://jlsteenwyk.com/contact.html).

---

## Change Log
### 1.1.3 (2026-02-24)
- Added new palettes: `tableau_ten`, `glasbey_twelve`, `viridis_eight`, and `cividis_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](https://github.com/JLSteenwyk/ggpubfigs).
- Palette and theme design are based on the original ggpubfigs publication and implementation.
