Publication-grade, modular matplotlib plotting for geoscience.
nicefigs is a thin, composable layer on top of matplotlib for figures in
geoscience papers. It provides one consistent house style, physical figure
sizing that keeps fonts at their point sizes across every panel, and
ready-made plots for the figures geoscientists draw most: global and regional
maps, agreement plots, model comparisons, scorecards, time series, ternary
compositions, verification diagrams and map animations.
Every helper takes an existing ax where that makes sense, so nicefigs pieces
drop into your own matplotlib layouts.
Gallery
The gallery shows every plot type with the code that drew it.
Install
pip install nicefigs # core: matplotlib, numpy, scipy, pillow
pip install "nicefigs[maps]" # + cartopy map projections and ocean clipping
pip install "nicefigs[all]" # + cartopy and xarray
Python 3.10 or newer. Without cartopy, maps fall back to a plain equirectangular axes.
Quick start
import nicefigs as nf
from nicefigs import data # deterministic synthetic example data
nf.set_theme("paper")
# A single-column figure; the height is solved from the aspect.
fig, ax = nf.subplots(width="single", aspect=0.8)
obs, pred = data.xy_agreement()
nf.agreement(obs, pred, ax=ax, units="mm d⁻¹") # KDE density, 1:1 line, fit, metrics
nf.save(fig, "agreement", formats=("pdf", "png"))
A global map with an inset-histogram colorbar:
import nicefigs as nf
from nicefigs import data
lon, lat, temp = data.global_points(field="temperature")
fig, ax, mappable = nf.map(lon, lat, temp, cmap="RdYlBu_r", colorbar_label="T [°C]")
Features
- One house style.
set_theme("paper" | "paper-large" | "talk" | "poster")globally, orwith nf.style(...):around existing matplotlib code. - Physical figure sizing.
width="single","double","slide", … plus an aspect; the free dimension is solved and fonts stay at their point sizes. - Maps. Robinson by default with Antarctica cropped, an inset histogram that doubles as the colorbar, ocean clipping, point, binned, raster, categorical and triangulated rendering, and regional extents.
- Colour. Geoscience colormaps and diverging norms, land-cover palettes (ESA WorldCover, ESRI, MODIS), a role palette for comparison figures, artist palettes, ternary and bivariate 2D colormaps with matching legends.
- Evaluation plots. Agreement plots, model-comparison violins, Taylor diagrams, scorecards with a skill-gap colouring, Pareto frontiers, caterpillar plots, reliability diagrams, rank histograms and precision–recall curves.
- Structure in space and time. Time series with ensemble bands, Hovmöller diagrams, cross-sections and vertical profiles, map animations to MP4 or GIF.
- Layout helpers. Panel labels, tight shared colorbars, facets, row and
column labels, and
check_text_overlapsto catch colliding text before submission.
Documentation
The full documentation, with a user guide and the API reference, is at https://earthyscience.github.io/nicefigs.
Contributing
git clone https://github.com/EarthyScience/nicefigs
cd nicefigs
uv venv && uv pip install -e ".[dev,docs]" && uv run pre-commit install
make check # pre-commit + tests, exactly what CI runs
make gallery # re-render docs/gallery and the README images
make docs-check # run every README/docs code example against its shown output
See RELEASING.md for how a release is cut.
License
MIT — see LICENSE.
Metadata
Release files for nicefigs 1.0.0
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 |
|---|---|---|---|---|
| nicefigs-1.0.0.tar.gz | 137.6 kB | With provenance | Details for nicefigs-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nicefigs-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for nicefigs-1.0.0-py3-none-any.whl |
Total release size: 255.2 kB
Release files / nicefigs-1.0.0.tar.gz
| Download URL | nicefigs-1.0.0.tar.gz |
|---|---|
| Size | 137.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dd340b8ac694cb4d55c39badc44fd0e85463ce5a2e0fbbd09bc6b6372b0082d7
|
|
BLAKE2b-256 checksum How to use checksums |
cf486b542610e677c51b993c167268f21e05ee12501c41cbd39add4b2ecc9f62
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.
Transparency logRelease files / nicefigs-1.0.0-py3-none-any.whl
| Download URL | nicefigs-1.0.0-py3-none-any.whl |
|---|---|
| Size | 117.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
183ffc950395b3ad239807bbb67efb58e363c9f661da86f048153f58b0e6c986
|
|
BLAKE2b-256 checksum How to use checksums |
9d0daccc38dbaaf965751e769c57a2331de403ed8e1bb5894dd6020eea4c10d4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.
Transparency logSecurity for nicefigs 1.0.0
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for nicefigs-1.0.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.
Transparency logA 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.