Pairwise data

An x series against a y series, drawn as a line, points, bars, a filled band, or a step – the shape most data starts in. Includes the reference-line family (axhline/axvline/axline) and the log-scale variant of the basic line plot.

Line plot

Line plot

Scatter plot

Scatter plot

Bar chart

Bar chart

Horizontal bar chart

Horizontal bar chart

Stem plot

Stem plot

Step plot

Step plot

Filled area

Filled area

Stack plot

Stack plot

Log-log, semilog-x and semilog-y axes

Log-log, semilog-x and semilog-y axes

Reference lines, spans & fills

Reference lines, spans & fills

Broken bar chart (Gantt)

Broken bar chart (Gantt)

Stairs

Stairs

Axline

Axline

hlines and vlines

hlines and vlines

Line styles

Line styles

Real marker shapes

Real marker shapes

Bar hatching

Bar hatching

Statistical distributions

Summarizing a batch of values rather than plotting them one by one: histograms in one and two dimensions, box and violin plots, error bars, event rasters, and a pie chart for simple composition.

Histogram

Histogram

Box plot

Box plot

Error bars

Error bars

Violin plot

Violin plot

Event plot

Event plot

2-D histogram

2-D histogram

Pie chart

Pie chart

Hexbin density

Hexbin density

Gridded data

A value defined over a 2-D grid rather than at a set of points: images, meshes (regular, curvilinear and Gouraud-shaded), contours, vector fields, and the matrix-specific matshow/spy views, plus the logarithmic colour norm that dense grids often need.

Image (imshow)

Image (imshow)

Pcolormesh

Pcolormesh

Contour lines

Contour lines

Quiver

Quiver

Filled contours (contourf)

Filled contours (contourf)

Curvilinear pcolormesh

Curvilinear pcolormesh

Gouraud shading

Gouraud shading

Log-scaled colors (LogNorm)

Log-scaled colors (LogNorm)

Matshow

Matshow

Spy

Spy

Colormap reference

Colormap reference

Small mesh: real data in the Vega/Vega-Lite export

Small mesh: real data in the Vega/Vega-Lite export

Discrete bins, a centered diverging scale, and custom colormaps

Discrete bins, a centered diverging scale, and custom colormaps

Slice: read a row of a heatmap as a line

Slice: read a row of a heatmap as a line

Slice: columns, and the profile in the heatmap’s place

Slice: columns, and the profile in the heatmap's place

Slice: several meshes scrubbed together

Slice: several meshes scrubbed together

Slice: only the axes you choose

Slice: only the axes you choose

Multi-axes layout and annotation

Techniques that sit on top of a plot type rather than being one: arranging several axes on one figure, a second y-axis sharing the same x-axis, a colorbar shared across axes, and annotating a point on the data.

Subplot grid

Subplot grid

Text and annotations

Text and annotations

Twin axes (twinx / twiny)

Twin axes (twinx / twiny)

Shared colorbar over a grid

Shared colorbar over a grid

Animation

A series with an extra frame dimension, scrubbed by a slider in interactive HTML and exportable to a self-contained looping GIF: plot_frames() for lines, pcolormesh_frames() for meshes.

Frame slider, and exporting it as a GIF

Frame slider, and exporting it as a GIF

Animated meshes across a subplot grid

Animated meshes across a subplot grid

Axes & figure manipulation

Post-creation manipulation of axes and figures – spines, per-axes cosmetics, tick placement, axes lifecycle, and the small matplotlib-compatibility conveniences (axis(), persistent margins(), per-axes prop cycles) that sit alongside the plotting methods themselves.

Spines

Spines

Per-axes facecolor

Per-axes facecolor

Hiding and removing axes

Hiding and removing axes

Tick position

Tick position

Minor ticks

Minor ticks

Linking axes after creation

Linking axes after creation

label_outer

label_outer

Margins and autoscale

Margins and autoscale

axis() convenience

axis() convenience

Per-axes color cycle

Per-axes color cycle

A different spine color per axes

A different spine color per axes

Tick styling

Tick styling

Restricting point picking to one axes

Restricting point picking to one axes

Draw order (zorder)

Draw order (zorder)

Custom legend entries

Custom legend entries

alpha, now everywhere matplotlib has it

alpha, now everywhere matplotlib has it

Boxed text and callouts (bbox=)

Boxed text and callouts (bbox=)

Multi-line, bold/italic, and axes-pinned text

Multi-line, bold/italic, and axes-pinned text

A 4x4 grid, each panel labeled in its own corner

A 4x4 grid, each panel labeled in its own corner

Six methods closing gaps against matplotlib’s Axes API

Six methods closing gaps against matplotlib's Axes API

Six small additions from a functionality audit

Six small additions from a functionality audit

Datetime axes, categorical axes, and declarative tick specs

Datetime axes, categorical axes, and declarative tick specs

Datetime Gantt chart with milestones

Datetime Gantt chart with milestones

More categorical axes and declarative tick formats

More categorical axes and declarative tick formats

Hidden axis labels (stored, not drawn)

Hidden axis labels (stored, not drawn)

Diagonal tick labels

Diagonal tick labels

Warning about (and auto-fixing) crowded labels

Warning about (and auto-fixing) crowded labels

Secondary and inset axes

Axes layered on top of or positioned relative to another axes: secondary_xaxis/secondary_yaxis (a same-units second scale), inset_axes (a small axes nested inside another’s box), and set_position (manual, un-managed placement).

Secondary axis

Secondary axis

Inset axes

Inset axes

Manual axes positioning

Manual axes positioning

Building a figure across processes

A Figure isn’t itself something a joblib/multiprocessing worker can share with the process that owns it – pickling one to hand it to a worker (or back) always produces a copy, never a live reference, so mutating an axes inside a worker never touches the original. fig.adopt_axes() is the fix: it merges an axes built standalone – most often a worker’s returned copy – into the real figure, in place of whichever of its own axes shares that grid position.

Fitting and plotting across processes, from a lazy parquet scan

Fitting and plotting across processes, from a lazy parquet scan

Custom interactive JS

fig.save(..., extra_js=...)/fig.to_html(..., extra_js=...) inline a caller-supplied JS string into the page – to add to plotpress’s own toolbar (include_default_js left at its default True: window.plotpressAddTool(...) registers a real button in its own row, joining the same single-selection group as Axis Span/Axis Zoom/Point Picking if given a mode), or to replace it entirely (include_default_js=False drops plotpress’s own JS – extra_js becomes the only interactivity this page gets, built from the raw #plotpress-meta/#plotpress-pick JSON payloads and #plotpress-svg directly). Nothing about either fetches anything external on its own – extra_js is inlined the same as plotpress’s own JS, same as every other interactive HTML plotpress writes.

Adding a custom tool to the existing toolbar

Adding a custom tool to the existing toolbar

Replacing the toolbar entirely with your own JS

Replacing the toolbar entirely with your own JS

Polar

Polar axes (projection="polar"): (theta, r) data projected onto the 2-D core with a circular grid built from ordinary artists.

Polar line

Polar line

Polar scatter

Polar scatter

Polar fill

Polar fill

Customizing the polar frame

Customizing the polar frame

Signal processing

Welch-averaged spectral estimators and lagged correlation – pure NumPy, drawn through the ordinary line/image artists.

Power spectral density

Power spectral density

Cross spectral density

Cross spectral density

Coherence

Coherence

Magnitude spectrum

Magnitude spectrum

Spectrogram

Spectrogram

Autocorrelation

Autocorrelation

Angle spectrum

Angle spectrum

Phase spectrum

Phase spectrum

Cross-correlation

Cross-correlation

Seaborn-style distribution plots

Distribution plots in the style of seaborn’s example gallery, drawn with plotpress’s own methods – kdeplot, ecdfplot, rugplot and the inner/cut options on violinplot. These take plain arrays rather than a tidy dataframe, so there is no pandas or seaborn dependency; the semantic-mapping API (hue=, FacetGrid) is deliberately not replicated.

Overlapping densities

Overlapping densities

Density over a histogram

Density over a histogram

Empirical cumulative distribution

Empirical cumulative distribution

Rug of raw observations

Rug of raw observations

Marginal rugs on a scatter

Marginal rugs on a scatter

Violin inner annotations

Violin inner annotations

Horizontal violins

Horizontal violins

Density tails and the cut parameter

Density tails and the cut parameter

Reloading data from a saved HTML

plotpress.load_data() reads the plotted data straight back out of a saved interactive HTML file – no need for the original Python objects that built it to still be around. These examples round-trip through it: reload a figure’s data, transform it, and rebuild a new figure in a similar layout.

Reload a mesh grid and replot one slice per panel as a line

Reload a mesh grid and replot one slice per panel as a line

Reload a mesh grid and FFT every panel

Reload a mesh grid and FFT every panel

Reload a grouped dashboard, preserving its group boxes

Reload a grouped dashboard, preserving its group boxes

Reload a figure’s titles, labels, and axis settings, not just its data

Reload a figure's titles, labels, and axis settings, not just its data

Reload a mesh grid as one labeled xarray.Dataset, analyze, and replot

Reload a mesh grid as one labeled xarray.Dataset, analyze, and replot

Reload a grid of line traces as one labeled xarray.Dataset, analyze, and replot

Reload a grid of line traces as one labeled xarray.Dataset, analyze, and replot

Hidden per-panel labels survive the round trip (and the Extract)

Hidden per-panel labels survive the round trip (and the Extract)

Reusable, data-free figure templates

Figure.to_template()/save_template() snapshot a figure’s own structure and styling – grid shape, group boxes, spine colors, tick overrides, ids, twin/secondary/inset overlays, and its Style – with no plotted data in it at all. plotpress.load_template()/ figure_from_template() rebuild a blank, identically styled figure from that snapshot. These examples build a template once and reuse it, unmodified, across unrelated datasets.

Build a template once, reuse it across two different datasets

Build a template once, reuse it across two different datasets

Limitations

Worked examples of plotpress’s known limitations – what causes each one, how large the effect is, and when it matters. These are deliberate trade-offs rather than bugs; Limitations explains the reasoning behind them.

Font metrics: which families plotpress can measure

Font metrics: which families plotpress can measure

Density estimates: binned above a few thousand points

Density estimates: binned above a few thousand points

Text is single-line, and PNG is a separate renderer

Text is single-line, and PNG is a separate renderer

Non-uniform meshes: vector cells by default, and when raster comes back

Non-uniform meshes: vector cells by default, and when raster comes back

The vector/raster trade at real scale: forcing it past the limit

The vector/raster trade at real scale: forcing it past the limit

Gallery generated by Sphinx-Gallery