Skip to main content

plot_io

Plots for PDF, PNG and JPEG in Python, drawn with pdf_io. No other dependency.

box plots

  • Familiar: a figure of plots; scatter, line, fill, box, heatmap, bar, hist, kde (1-D and 2-D), ecdf, violin, strip, swarm, area, errorbar, stem, regression, hist2d, hexbin, contour, pie; reference lines, spans, text and annotations; color, marker, alpha, limits, scale, legend, sizes in inches.
  • One way to set things: keywords at creation or set(...) on any object; figure settings (font, palette, line width…) are inherited by plots and series.
  • Layouts: an explicit grid of ids with spans, or automatic rows and columns; plots sized individually; axis lines (or plot borders) aligned across the figure; margins from the real text metrics; shared axes; secondary axes; facets of a table.
  • Data: columns of any table by name (data=: dicts, pandas, polars, numpy), one series per group (group=), numbers given as colors or sizes, point density (scipy's gaussian_kde, in C) for colors, sizes, opacity and drawing order.
  • Axes: linear, log, log2, log10, sqrt, exp, symlog, logit, time and category scales; limits such as "0/max" or "q:0.01/q:0.99"; ticks with shared decimals and ×10ᵏ factors, calendar ticks for dates.
  • Colors: a colorblind-safe palette, color maps interpolated in Oklab, colorbars; marker sizes by area, equal for every shape.
  • Styles: style="matplotlib", "seaborn", "ggplot2", "altair", "matlab", "chartjs", "plotly", "bokeh", "observable", "excel", "fivethirtyeight", "economist", "tufte" and variants give the look of those libraries; styles are presets of settings, and your own build on them.
  • Large data: one million points mapped and drawn in C; simplify="auto" drops what cannot be seen, rasterize= turns a series into an image inside the PDF.

Install

pip install /path/to/pdf_io      # pdf_io 0.4 or later
pip install .

Python 3.11+.

Quick start

import plot_io as pl

s = pl.Scatter(x, y, name="data")
s.plot.x_axis(label="Time (s)")
s.plot.save("scatter.pdf")
fig = pl.Figure(grid=[[1, 1, 2], [3, 4, 2]])
p = fig.plot(1, title="Signal")
p.line(t, v, name="raw")
p.fill(t, upper, lower, alpha=0.3)
p.y_axis(scale="log10", label="Power")
fig.plot(2).box({"a": va, "b": vb})
h = fig.plot(3).heatmap(matrix, x=columns, y=rows, cmap="magma", colorbar=True)
fig.plot(4).scatter(x, y, c=z, cmap="viridis")
fig.save("figure.pdf")
fig.save("figure.png", dpi=200)
fig = pl.Figure(style="ggplot2")                         # or a dict: {"base": "seaborn", "font_size": 9}
p = pl.Plot()
p.scatter("umap_x", "umap_y", data=genes, c="density", order="density")   # columns of a table
p.scatter("x", "y", data=df, group="cluster", marker="auto")              # one series per group
fig = pl.facet(df, col="condition", row="replicate")                       # small multiples
fig.scatter("x", "y")

Documentation

Development

python -m unittest discover -s tests -t tests
flake8 --select F plot_io tests && mypy
python tools/bench.py --check       # timings against the targets
python tools/settings_doc.py        # regenerate the settings tables of API.md

Metadata

Release files for plot-io 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for plot-io 0.1.0
File Size Uploaded Provenance
plot_io-0.1.0.tar.gz 3.7 MB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for plot-io 0.1.0
File Interpreter ABI Platform
plot_io-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 3.9 MB

Release files / plot_io-0.1.0.tar.gz

Download URL plot_io-0.1.0.tar.gz
Size 3.7 MB
Tags Source
SHA-256 checksum
How to use checksums
1d5929d07472287e38f3e53cb3ecc1a19bc74fd2c86a0e090db0beb6cd30631f
BLAKE2b-256 checksum
How to use checksums
3f644ce04a5e387c0eee89ba699b6a1e19cfa07d7b0df1a95fd6ccd417a9508e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / plot_io-0.1.0-py3-none-any.whl

Download URL plot_io-0.1.0-py3-none-any.whl
Size 203.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
750585f08d176e9603ffec02a50c5f6965554710d6baaa06be7ba2f8e0fb8ca2
BLAKE2b-256 checksum
How to use checksums
a62622acc6f9f647479fe49df3bc3fe3dbf92b907855c68c49454b3bc1e30a84
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Security for plot-io 0.1.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.

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page