Python plotting ยท Rust rendering path

Static matplotlib-style figures, native renderer

Matplotvite maps NumPy arrays and dataframes to a fast Rust renderer and writes PNG, SVG, PDF, or WebP output. The public API follows matplotlib's pyplot and object-oriented interfaces where practical.

Browse examples Compare backends Performance measurements
maturin develop --release

Design notes

Compiled rendering path

Coordinate transforms, axis layout, text shaping, and image encoding run in Rust. Python is used for the plotting interface and array input.

Minimal runtime surface

The wheel depends on NumPy only. It does not import matplotlib, Pillow, or a system graphics stack such as Cairo or Pango.

Static output formats

PNG and lossless WebP are rasterized directly. SVG preserves vector paths, and PDF keeps text selectable rather than embedding a raster image.

Embedded typography

The Geist sans, serif, and mono faces are compiled into the extension, so output does not depend on fontconfig or host font discovery.

Panel parallelism and caching

Subplot panels render concurrently with Rayon, and repeated saves of an unchanged figure reuse the encoded bytes.

Compatibility scope

The API covers common static plotting calls. It is not a complete matplotlib implementation; unsupported call sites are tracked in TRACE.md.

Coverage

96%

9,758 / 10,098 call sites

Static scan of 91 matplotlib 3.11.2 test files. The CI trace job re-runs this check and fails on any drop.

  • 785covered
  • 60needs API
  • 104failed
  • 133unsupported

1,082 comparison-gallery cases, 72% covered. A case needs API when the call exists in matplotlib but not here; it failed when matplotvite could not render it.

AreaExamples in this gallery
Line plotsplot, step, stairs, fill_between, fill_betweenx, axhline, axvline, axis spans, explicit limits
Statisticsscatter, errorbar, histogram, boxplot, violinplot, stem, eventplot, broken_barh
Categorical databar, barh, bar_label, pie, stackplot, string categories
Gridded dataimshow, contour, contourf, pcolormesh, hist2d, hexbin, quiver, colorbar
Layoutsubplots, subplot, GridSpec, subplot_mosaic, twinx/twiny, suptitle
Data typesdatetime and datetime64, pandas DataFrames and Series, categorical axes
Axes and textticks and rotation, tick_params, grid, legends, text, annotate, mathtext, log scales
Styling and output182 colormap names, style contexts, rcParams, PNG, SVG, PDF, WebP