An up-to-date and slimmed down library for opinionated plotting styles with seaborn and matplotlib
Project description
evaplot
An up-to-date and slimmed down library for opinionated plotting styles with seaborn and matplotlib.
Installation
pip install evaplot
Quick Start
import evaplot
import seaborn as sns
import matplotlib.pyplot as plt
# Apply a style (downloads fonts on first use)
evaplot.set_style("evaplot_rc")
# Use seaborn/matplotlib as usual
fig, ax = plt.subplots()
sns.barplot(data=my_data, x="category", y="value", ax=ax)
plt.show()
Styles
evaplot ships six styles, each using a different Google Font (downloaded automatically on first import):
| Style | Font |
|---|---|
evaplot_rc |
Roboto Condensed |
evaplot_fsc |
Fira Sans Condensed |
evaplot_j |
Jost |
evaplot_m |
Montserrat |
evaplot_sg |
Space Grotesk |
evaplot_tw |
Titillium Web |
Gallery
evaplot_rc — Roboto Condensed
Other styles
evaplot_fsc — Fira Sans Condensed
evaplot_j — Jost
evaplot_m — Montserrat
evaplot_sg — Space Grotesk
evaplot_tw — Titillium Web
Helper Functions
set_cat_palette
Sets the categorical color palette based on the number of categories. Uses dark2 for n ≤ 8 and vivid for larger sets. Returns the full palette as a list of hex strings you can reuse directly for annotations, custom patches, or other matplotlib elements.
colors = evaplot.set_cat_palette(n=5)
# colors → ["#1b9e77", "#d95f02", ...]
# Annotate each bar with its hex color
for i, bar in enumerate(ax.patches):
ax.text(
bar.get_x() + bar.get_width() / 2,
bar.get_height(),
colors[i],
ha="center", va="bottom",
color=colors[i], fontsize=8,
)
rotate_xticklabels
Rotates x-axis tick labels to prevent overlap on busy categorical axes. Works on individual Axes objects and on every panel of a FacetGrid by iterating g.axes.flat.
# single axes
evaplot.rotate_xticklabels(ax, rotation=45)
# every panel in a FacetGrid
for ax in g.axes.flat:
evaplot.rotate_xticklabels(ax, rotation=45)
move_legend
Moves a seaborn legend with sensible bottom-centered defaults.
evaplot.move_legend(ax_or_facetgrid, bbox_to_anchor=(0.5, -0.15), loc="upper center", ncol=3)
adjust_layout
Adjusts subplot spacing and applies tight_layout in one call. Pass g.fig for a seaborn FacetGrid, or omit fig to operate on the current figure.
evaplot.adjust_layout(fig=fig, hspace=0.35, wspace=0.3)
set_facet_col_titles
Simplifies FacetGrid column titles using a template string. By default strips the verbose "col = value" prefix.
evaplot.set_facet_col_titles(g, "{col_name}")
| Before | After |
API Reference
| Function | Description |
|---|---|
set_style(style, n) |
Apply an evaplot style and categorical palette |
set_cat_palette(n) |
Set categorical palette (dark2 for n ≤ 8, vivid otherwise); returns hex color list |
rotate_xticklabels(ax, rotation, ha) |
Rotate x-axis tick labels |
move_legend(obj, bbox_to_anchor, loc, ncol, ...) |
Move a seaborn legend with opinionated defaults |
adjust_layout(fig, hspace, wspace, bottom, rect) |
Adjust subplot spacing and apply tight_layout |
set_facet_col_titles(g, template) |
Set FacetGrid column title template |
show_installed_fonts() |
List font families in evaplot's font cache |
update_matplotlib_fonts() |
Register all cached fonts with matplotlib |
download_googlefont(font, add_to_cache) |
Download a Google Font to the cache |
Credits
evaplot builds on opinionated by Maximilian Noichl.
Noichl, M. (2023). Opinionated: Simple, Clean Stylesheets for Plotting with Matplotlib and Seaborn (Version 0.0.2.8) [Computer software]. https://doi.org/10.5281/zenodo.8329780
License
MPLv2 License
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 evaplot-0.1.0.tar.gz.
File metadata
- Download URL: evaplot-0.1.0.tar.gz
- Upload date:
- Size: 3.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4ddbdbe68e9323beb2dbb626a41dc43b48d566f6e0e3cb1d2d1baa3367129bab
|
|
| MD5 |
2969c885243e165c9e208df64c3ca47b
|
|
| BLAKE2b-256 |
996d17ff71e79fb1428b4323547356c06410b2e8d20ebc472c50a38de6b20ffc
|
Provenance
The following attestation bundles were made for evaplot-0.1.0.tar.gz:
Publisher:
ci.yml on evamaxfield/evaplot
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
evaplot-0.1.0.tar.gz -
Subject digest:
4ddbdbe68e9323beb2dbb626a41dc43b48d566f6e0e3cb1d2d1baa3367129bab - Sigstore transparency entry: 1496512422
- Sigstore integration time:
-
Permalink:
evamaxfield/evaplot@3e0b3018d4b58839c0d4f529f10514edd0b1d7ae -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/evamaxfield
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@3e0b3018d4b58839c0d4f529f10514edd0b1d7ae -
Trigger Event:
push
-
Statement type:
File details
Details for the file evaplot-0.1.0-py3-none-any.whl.
File metadata
- Download URL: evaplot-0.1.0-py3-none-any.whl
- Upload date:
- Size: 447.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ccc62d18fe49c208de91f364452c3b996a571b06ab452154f51111621c2cc261
|
|
| MD5 |
ae7e447b45d826578d676f60534da4c8
|
|
| BLAKE2b-256 |
0c7e53737bfdf16a94b1537f0c2992a3655ee7b2e81d4b8467ce0c9bb868eba9
|
Provenance
The following attestation bundles were made for evaplot-0.1.0-py3-none-any.whl:
Publisher:
ci.yml on evamaxfield/evaplot
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
evaplot-0.1.0-py3-none-any.whl -
Subject digest:
ccc62d18fe49c208de91f364452c3b996a571b06ab452154f51111621c2cc261 - Sigstore transparency entry: 1496512548
- Sigstore integration time:
-
Permalink:
evamaxfield/evaplot@3e0b3018d4b58839c0d4f529f10514edd0b1d7ae -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/evamaxfield
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@3e0b3018d4b58839c0d4f529f10514edd0b1d7ae -
Trigger Event:
push
-
Statement type: