Skip to content

Ferrum

Grammar-of-graphics statistical visualization for Python, with a Rust core. One chart model for statistical graphics, interactive views, and ML diagnostics.

Get started Why Ferrum


One mental model, from scatter plot to SHAP summary

Ferrum is a statistical visualization library built around one idea: every chart should follow the same mental model. A scatter plot, a faceted histogram, a ROC curve, and a SHAP beeswarm are all charts, so Ferrum builds them from the same grammar of data, encodings, marks, scales, coordinates, and statistical transforms.

A practitioner moving from Altair, Seaborn, or Yellowbrick should be able to reach for the charts they need without falling back to matplotlib — and without paying the tax of switching abstractions every time the question changes.

What Ferrum is for

  • Grammar of graphics, without the ceiling


    Declarative, composable, layered — like Altair or plotnine — but no row limits and no API switch when data grows. Auto-raster and GPU rendering happen transparently behind the same spec.

  • Stat transforms in the pipeline


    KDE, LOESS, bootstrap CIs, binning — declared in the chart, computed in Rust before rendering. You stop preprocessing data before plotting.

  • Diagnostics that compose


    ROC curves, SHAP beeswarm, residuals, calibration — same grammar, same theme, same .save(). fm.hconcat(roc_chart, confusion_chart) just works.

  • Zero system dependencies


    Ships in a wheel. No Cairo, no X11, no display server. Renders in Kubernetes, CI, SSH sessions. pip install is the entire setup.

  • SHAP and ICE at full sample size


    The plots that matter most for understanding models at scale — the ones existing tools sample or crash on — render in full because the rasterization is in Rust and the interactivity is GPU-backed.

  • Handles every dataframe API


    Polars, pandas, modin, cuDF, dask, and ibis all flow through the same Chart(data) constructor. Narwhals normalizes the input to Arrow once; the Rust core sees one shape. No per-framework adapters in your code, no special-case ingestion paths in ferrum.

  • New to Ferrum?


    Install it, render your first plot, then read Why Ferrum to see what makes it different from seaborn, Altair, or Yellowbrick.

  • Want the design rationale?


    The Concepts pages explain the core beliefs — one chart model, stats in the rendering pipeline, model outputs as data, and performance as a public-API concern.

  • Prefer to see it work?


    The Gallery walks through hand-crafted examples, each one teaching a technique rather than just rendering a figure.

  • Looking up a specific symbol?


    The API Reference covers every public class and function — from Chart and encoding to plots, themes, selection, and more.