Skip to main content

Ferrum chart examples: linear model, decision boundary, pairplot, SHAP beeswarm

Ferrum

Grammar-of-graphics statistical visualization for Python, with a Rust core.

Ferrum builds every chart — scatter plot, faceted histogram, ROC curve, SHAP beeswarm — from the same grammar of data, encodings, marks, scales, and statistical transforms. The declaration layer is Python; the computation engine is Rust compiled via PyO3.

Install

For 'batteries included'-- ML diagnostic plots and interactive Jupyter rendering:

pip install ferrum-viz[all]   # recommended — optional deps for fitted-model diagnostics (scikit-learn), SHAP, and Jupyter interactive

For a lean install without optional extras:

pip install ferrum-viz

Quickstart

import ferrum as fm
import polars as pl

df = pl.DataFrame({"x": [1, 2, 3, 4], "y": [2, 4, 3, 5], "group": ["a", "a", "b", "b"]})

chart = fm.Chart(df).mark_point().encode(x="x", y="y", color="group:N")
chart.save("scatter.svg")
chart.to_png()  # raster output, no display server needed

Key features

  • One chart model — scatter plots, statistical graphics, and ML diagnostics share the same grammar and compose with +, |, &.
  • Stat transforms in the pipeline — KDE, LOESS, bootstrap CIs, binning, and aggregations are declared in the chart spec and computed in Rust.
  • Model diagnostics as charts — fm.roc_chart(model, X, y), fm.confusion_matrix_chart(...), fm.shap_chart(...) return regular Chart objects.
  • Zero system dependencies — no Cairo, no X11, no display server. Renders anywhere pip install works.
  • DataFrame pluralism — polars, pandas, modin, cuDF, dask, ibis, and pyarrow all work through Chart(data).
  • Interactive rendering — chart.interactive() switches to a GPU-backed WASM renderer with selections, zoom/pan, linked views, and tooltips. Backed by anywidget for Jupyter.

Themes

Twelve built-in themes — from warm cream (Paper Ink, the default) to dark, publication, and editorial styles.

All 12 Ferrum themes

Performance

200,000-point scatter benchmark (median of 3 runs, Apple M-series):

Metric Ferrum plotnine seaborn Altair Plotly
SVG render 27 ms 7.56 s 1.95 s 2.86 s 2.51 s
SVG file size 590 KB 137 MB 32.6 MB 57.8 MB 267 KB
PNG render 78 ms 2.35 s 119 ms — 2.50 s
Interactive HTML 4.9 MB — — 14.3 MB 9.8 MB

At 1M points, Altair OOMs and plotnine takes 39 s. Ferrum renders in 57 ms. Full benchmarks →

How Ferrum compares

Ferrum plotnine seaborn Altair Plotly
Grammar Layered, typed encodings, faceting ggplot2 port, full GoG Convenience helpers Vega-Lite declarative Imperative traces
Diagnostics 44 helpers, 28 visualizers — — — —
Composition + | & operators + layers, facets only Manual subplots | & (Vega-Lite) make_subplots
Interactivity WASM/GPU, selections, linked views matplotlib backends matplotlib backends Vega-Lite selections Plotly.js
Scale ceiling 10M+ rows ~100k marks ~100k marks ~5k rows ~500k marks
DataFrames polars, pandas, modin, cuDF, dask, ibis pandas only pandas only pandas, polars pandas, polars
System deps None matplotlib matplotlib None None
Backend Rust (SVG, raster, WASM) matplotlib matplotlib Vega-Lite (V8) Plotly.js (kaleido)

Detailed migration guides → for plotnine, seaborn, yellowbrick, and scikit-plot.

Examples

# Layer a LOESS trend on a scatter plot
points = fm.Chart(df).mark_point(opacity=0.6).encode(x="x", y="y", color="group:N")
trend = fm.Chart(df).mark_smooth(method="loess").encode(x="x", y="y", color="group:N")
chart = points + trend

# Compose diagnostics into a model report
source = fm.ModelSource(model, X_test, y_test)
report = (fm.roc_chart(source) | fm.confusion_matrix_chart(source)) & fm.importance_chart(source)
report.save("model_report.svg")

# Figure-level helpers
fm.displot(df, x="value", hue="group", kind="kde")
fm.catplot(df, x="species", y="measurement", kind="violin")
fm.pairplot(df, vars=["a", "b", "c"], hue="label")

Architecture

Layer Role
src/ferrum/ Python declaration API — Chart, encodings, marks, themes, plots
crates/ferrum-core/ Rust computation engine — transforms, scales, rendering
Arrow CDI Zero-copy data transport between Python and Rust via pyo3-arrow

Development

Requires Python 3.10+, Rust toolchain, and maturin.

uv sync
unset CONDA_PREFIX && uv run --no-sync maturin develop   # build Rust extension
uv run pytest                                            # run tests

How this was built

Documentation

Full docs at ferrumviz.com.

License

See LICENSE for details.

Metadata

Release files for ferrum-viz 0.24.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 ferrum-viz 0.24.0
File Size Uploaded Provenance Actions
ferrum_viz-0.24.0.tar.gz 8.3 MB With provenance Details for ferrum_viz-0.24.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for ferrum-viz 0.24.0
File Actions
ferrum_viz-0.24.0-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details for ferrum_viz-0.24.0-cp310-abi3-win_amd64.whl
ferrum_viz-0.24.0-cp310-abi3-musllinux_1_2_x86_64.whl CPython 3.10 abi3 Linux musl 1.2+ x86-64 Details for ferrum_viz-0.24.0-cp310-abi3-musllinux_1_2_x86_64.whl
ferrum_viz-0.24.0-cp310-abi3-musllinux_1_2_aarch64.whl CPython 3.10 abi3 Linux musl 1.2+ ARM64 Details for ferrum_viz-0.24.0-cp310-abi3-musllinux_1_2_aarch64.whl
ferrum_viz-0.24.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-64 Details for ferrum_viz-0.24.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
ferrum_viz-0.24.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details for ferrum_viz-0.24.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
ferrum_viz-0.24.0-cp310-abi3-macosx_10_12_universal2.macosx_10_12_x86_64.macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64, macOS 10.12+ universal2 (ARM64, x86-64), macOS 10.12+ x86-64 Details for ferrum_viz-0.24.0-cp310-abi3-macosx_10_12_universal2.macosx_10_12_x86_64.macosx_11_0_arm64.whl

Total release size: 77.9 MB

Release files / ferrum_viz-0.24.0.tar.gz

Download URL ferrum_viz-0.24.0.tar.gz
Size 8.3 MB
Tags Source
SHA-256 checksum
How to use checksums
099b88f4e7cf99803dd1e413670591f9b18b129706519dc9ebf221713c69c46b
BLAKE2b-256 checksum
How to use checksums
2f41994f89f0219d0ac4ca395c35e50594b2453a7ac3d468fceae635f451bb96
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 9, 2026.

Transparency log

Release files / ferrum_viz-0.24.0-cp310-abi3-win_amd64.whl

Download URL ferrum_viz-0.24.0-cp310-abi3-win_amd64.whl
Size 10.9 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
d5fae9352b0628822438083e36fa18dc758cba68ad75958a8d8ffb028e3033aa
BLAKE2b-256 checksum
How to use checksums
5eee9eaf2d0a62d1ffaf7497750c4bab2ea9aa946fd24b7406bdbafe78ef38bf
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 9, 2026.

Transparency log

Release files / ferrum_viz-0.24.0-cp310-abi3-musllinux_1_2_x86_64.whl

Download URL ferrum_viz-0.24.0-cp310-abi3-musllinux_1_2_x86_64.whl
Size 10.8 MB
Tags CPython 3.10 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
9ae6523a1c2dd923600aacdbaf9ebcd7fc28d40e3004697f42113d5ebf34fe18
BLAKE2b-256 checksum
How to use checksums
cf1c27c6387afa251fd8f767b1c0ee16d5c4a60f6016aa6b6263b2f373d559c2
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 9, 2026.

Transparency log

Release files / ferrum_viz-0.24.0-cp310-abi3-musllinux_1_2_aarch64.whl

Download URL ferrum_viz-0.24.0-cp310-abi3-musllinux_1_2_aarch64.whl
Size 9.8 MB
Tags CPython 3.10 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
3a43a15ed857b2ecc21f4c2618de00bdc855115c10044c7a8f2f52e953c6316b
BLAKE2b-256 checksum
How to use checksums
ff4fabeac61008b4f0d43b4a903a97fea144e3c0a48b085445ed9159038c1190
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 9, 2026.

Transparency log

Release files / ferrum_viz-0.24.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL ferrum_viz-0.24.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 10.5 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
14f79c1427a3cb350e4f33ca358d5b8b74e9f9df548555af951799d27229cc01
BLAKE2b-256 checksum
How to use checksums
d063580f4a14237c35198e4d4c99e4a209a1f462cf21ea6e86578db7db83d21d
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 9, 2026.

Transparency log

Release files / ferrum_viz-0.24.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL ferrum_viz-0.24.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 9.6 MB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
18e7f3d9ea40debe2e6b26fe2744f39504ab0e19d1fad104007f5a876da9cfdc
BLAKE2b-256 checksum
How to use checksums
b678875addf6609895f806e27b82dae6e4cb8c34a21b97aa157065474eedd187
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 9, 2026.

Transparency log

Release files / ferrum_viz-0.24.0-cp310-abi3-macosx_10_12_universal2.macosx_10_12_x86_64.macosx_11_0_arm64.whl

Download URL ferrum_viz-0.24.0-cp310-abi3-macosx_10_12_universal2.macosx_10_12_x86_64.macosx_11_0_arm64.whl
Size 18.0 MB
Tags CPython 3.10 abi3 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
79af13dca593b99ba233e67f885ebafb0723ab79065d1286754add6d8ed25a60
BLAKE2b-256 checksum
How to use checksums
8a228fe631139990b165ca2e2c62075b51071ed0e232af15b7e728f278f2c883
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 9, 2026.

Transparency log

Security for ferrum-viz 0.24.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

All 7 files in this release have been uploaded with provenance metadata.

Select from 7 files

Attestation for ferrum_viz-0.24.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 9, 2026.

Transparency log

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.24.0 This release

7 release files Full 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