plotting_utils
A Python package providing elegant wrappers around matplotlib and seaborn functions to make scientific plotting easier and more consistent.
Features
🎨 Color Palettes
- Custom color schemes:
ten_godisnot,darjeeling,fantastic_fox - Palette creation utilities:
create_palette()for generating custom color schemes
📊 Plotting Functions
High-level plotting functions with sensible defaults:
- Basic plots:
scatter(),bar(),box(),strip(),violin() - Distribution plots:
dist(),counts_plot() - Specialized plots:
heatmap(),dotplot(),volcano(),stem_plot(),rank_plot() - Statistical plots: Built-in support for statistical annotations with
add_wilcox()
🛠 Utility Functions
- Styling:
set_rcParams()for Nature journal-style settings - Plot enhancement:
format_ax(),add_legend(),add_cbar() - File operations:
save_best_pdf_quality(),make_folder() - Performance:
Timerclass for benchmarking
Installation
pip install ac-plotting-ut
Note on the package name. This project was previously published on PyPI as
plotting_utils. From v0.2.0 it is distributed asac-plotting-ut. The import name is unchanged —import plotting_utils as plukeeps working. The oldplotting_utilsdistribution is no longer updated; please installac-plotting-utinstead.
Quick Start
import matplotlib.pyplot as plt
import pandas as pd
import plotting_utils as plu
# Set journal-style parameters
plu.set_rcParams()
df = pd.DataFrame({
'x': [1, 2, 3, 4],
'y': [2, 4, 5, 8],
'group': ['a', 'a', 'b', 'b'],
})
# Scatter, coloured by a categorical column
fig, ax = plt.subplots(figsize=(6, 4))
plu.scatter(df, 'x', 'y', by='group', ax=ax)
plu.format_ax(ax, xlabel='X values', ylabel='Y values', reduced_spines=True)
# Save at publication quality
plu.save_best_pdf_quality(fig, figsize=(6, 4), path='.', name='my_plot.pdf')
Requirements
Python 3.10+, plus numpy, pandas, scipy, matplotlib, seaborn,
scikit-learn, joblib, pillow, statannotations and textalloc.
These are installed automatically.
Development
pip install -e ".[test]"
pytest
Release History
0.2.0
- Renamed the PyPI distribution to
ac-plotting-ut(import name unchanged) - Modern
pyproject.tomlpackaging;setup.pyremoved - Declared previously-missing dependencies:
numpy,pandas,scipy,pillow - Requires Python 3.10+; verified against numpy 2.x, pandas 2.3, matplotlib 3.11, seaborn 0.13
- Added a test suite and CI across Linux/macOS on Python 3.10–3.12
- Fixed
volcano()failing with its own defaultylim - Fixed
volcano()andrank_plot()label placement on non-integer indices - Fixed
rank_plot()passing an invalid argument toax.scatter - Fixed
dotplotandrank_plotmissing from__all__ violin()no longer requires an explicitcategorical_cmap=Nonewhenbyis unset
0.1.4 (2025-09-11)
- Enhanced README with comprehensive documentation
- Added proper package metadata (long_description, author, classifiers)
- Improved PyPI package presentation
0.1.3
- Previous stable release
License
See LICENSE file for details.
Version
Current version: 0.1.4
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 ac_plotting_ut-0.2.0.tar.gz.
File metadata
- Download URL: ac_plotting_ut-0.2.0.tar.gz
- Upload date:
- Size: 17.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f8f98ccac03f6eec9d5f1402063a942c469cf0952243dd7ae1a037098c2c4896
|
|
| MD5 |
1740f23cd7062e1550c2ff26eb1cb933
|
|
| BLAKE2b-256 |
f469cbcbf0fd02f9cd1c55f3f47b0ff12479b8516f28c768a4d0746c85462a5f
|
Provenance
The following attestation bundles were made for ac_plotting_ut-0.2.0.tar.gz:
Publisher:
release.yaml on andrecossa5/plotting_utils
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ac_plotting_ut-0.2.0.tar.gz -
Subject digest:
f8f98ccac03f6eec9d5f1402063a942c469cf0952243dd7ae1a037098c2c4896 - Sigstore transparency entry: 2343796802
- Sigstore integration time:
-
Permalink:
andrecossa5/plotting_utils@b8731e84d245f4ffe45e42f453c8f545ed72c7f9 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/andrecossa5
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@b8731e84d245f4ffe45e42f453c8f545ed72c7f9 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ac_plotting_ut-0.2.0-py3-none-any.whl.
File metadata
- Download URL: ac_plotting_ut-0.2.0-py3-none-any.whl
- Upload date:
- Size: 15.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ceaf72277e8afa8bea0ff212131395e4e05904de6673cd375d0cf249e6c1c3df
|
|
| MD5 |
a7afc57ffca8f64eb7fe78f66e4e2e92
|
|
| BLAKE2b-256 |
8adef00cd8c4f38d06c43984539fb2276a7f7ee13c99492e204000df383f78ed
|
Provenance
The following attestation bundles were made for ac_plotting_ut-0.2.0-py3-none-any.whl:
Publisher:
release.yaml on andrecossa5/plotting_utils
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ac_plotting_ut-0.2.0-py3-none-any.whl -
Subject digest:
ceaf72277e8afa8bea0ff212131395e4e05904de6673cd375d0cf249e6c1c3df - Sigstore transparency entry: 2343796837
- Sigstore integration time:
-
Permalink:
andrecossa5/plotting_utils@b8731e84d245f4ffe45e42f453c8f545ed72c7f9 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/andrecossa5
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@b8731e84d245f4ffe45e42f453c8f545ed72c7f9 -
Trigger Event:
push
-
Statement type: