Skip to content

Gallery

A visual tour of Ferrum's chart surface. Every image below was rendered by Ferrum's Rust engine — no matplotlib, no browser, no external renderer. Each card includes the API call so you can reproduce it with your own data. Where both exist, helper shows the one-line shortcut and grammar shows the underlying mark + encode call — both produce the same chart.

Primitive marks

The building blocks. Each mark maps directly to a geometric shape.

  • Point


    mark_point

    fm.Chart(df).mark_point().encode(x="x", y="y", color="class")

  • Line


    mark_line

    fm.Chart(df).mark_line().encode(x="month", y="value", color="group")

  • Bar


    mark_bar

    fm.Chart(df).mark_bar(position=fm.Dodge()).encode(x="quarter", y="sales", color="region")

  • Area


    mark_area

    fm.Chart(df).mark_area(position=fm.Stack()).encode(x="x", y="value", color="series")

  • Rule


    mark_rule

    fm.Chart(df).mark_point() + fm.Chart(rule_df).mark_rule().encode(y="ref_y")

  • Tick


    mark_tick

    fm.Chart(df).mark_tick().encode(x="value", y="group")

  • Rect


    mark_rect

    fm.Chart(df).mark_rect().encode(x="x", y="y", color="value")

  • Text


    mark_text

    fm.Chart(df).mark_text().encode(x="x", y="y", text="label")

Statistical marks

These marks compute a transform on your data before rendering — KDE, binning, smoothing, quantiles.

  • Histogram


    mark_histogram

    helper: fm.displot(df, x="value", hue="group", kind="hist")

    grammar: fm.Chart(df).mark_histogram(groupby="group").encode(x="value", color="group")

  • Density (KDE)


    mark_density

    helper: fm.displot(df, x="value", hue="group", kind="kde")

    grammar: fm.Chart(df).mark_density(groupby="group").encode(x="value", color="group")

  • Smooth (linear)


    mark_smooth_lm

    helper: fm.lmplot(df, x="x", y="y")

    grammar: fm.Chart(df).mark_smooth(method="lm").encode(x="x", y="y")

  • Smooth (LOESS + CI)


    mark_smooth_ci

    helper: fm.lmplot(df, x="x", y="y", method="loess")

    grammar: fm.Chart(df).mark_smooth(ci=0.95).encode(x="x", y="y")

  • Contour


    mark_contour

    fm.Chart(df).mark_contour().encode(x="x", y="y")

  • QQ plot


    mark_qq

    fm.Chart(df).mark_qq().encode(x="value")

  • Hex binning


    mark_hex

    fm.Chart(df).mark_hex().encode(x="x", y="y")

  • Raster


    mark_raster

    fm.Chart(df).mark_raster().encode(x="x", y="y")

Distribution marks

Summarize distributions across categories.

  • Boxplot


    mark_boxplot

    helper: fm.catplot(df, x="group", y="value", kind="box")

    grammar: fm.Chart(df).mark_boxplot().encode(x="group", y="value")

  • Boxen (letter-value)


    mark_boxen

    helper: fm.catplot(df, x="group", y="value", kind="boxen")

    grammar: fm.Chart(df).mark_boxen().encode(x="group", y="value")

  • Violin


    mark_violin

    helper: fm.catplot(df, x="group", y="value", kind="violin")

    grammar: fm.Chart(df).mark_violin().encode(x="group", y="value")

  • Swarm


    mark_swarm

    helper: fm.catplot(df, x="group", y="value", kind="swarm")

    grammar: fm.Chart(df).mark_swarm().encode(x="group", y="value")

Uncertainty marks

Show the spread around an estimate.

  • Error bar


    mark_errorbar

    fm.Chart(df).mark_errorbar(extent="stdev").encode(x="group", y="value")

  • Ribbon


    mark_ribbon

    fm.Chart(df).mark_ribbon().encode(x="x", y="lower", y2="upper")

Composition

Multiple marks and charts combined into compound views.

  • Scatter + smooth + CI


    comp_scatter_smooth_ci

    fm.Chart(df).mark_point(opacity=0.3).mark_smooth(ci=0.95).encode(x="x", y="y")

  • Histogram + density overlay


    comp_histogram_density

    fm.Chart(df).mark_histogram() + fm.Chart(df).mark_density()

  • Line + ribbon


    comp_line_ribbon

    fm.Chart(df).mark_ribbon().encode(x="x", y="lower", y2="upper") + fm.Chart(df).mark_line()

  • Boxplot + swarm


    comp_boxplot_swarm

    fm.Chart(df).mark_boxplot() + fm.Chart(df).mark_swarm()

  • Dodged bar + error bar


    comp_dodge_bar_errorbar

    fm.Chart(df).mark_bar(position=fm.Dodge()) + fm.Chart(df).mark_errorbar()

  • Grouped smooth


    comp_grouped_smooth

    fm.Chart(df).mark_smooth(method="lm", groupby="group").encode(x="x", y="y", color="group")

  • Faceted smooth


    comp_faceted_smooth

    fm.Chart(df).mark_point().mark_smooth(groupby="dose").encode(...).facet(col="dose")

  • Horizontal concat


    comp_hconcat

    fm.hconcat(chart_hex, chart_violin)

Figure-level helpers

One-line entry points for common chart patterns.

  • displot (histogram)


    displot_hist

    helper: fm.displot(df, x="value", hue="group", kind="hist")

    grammar: fm.Chart(df).mark_histogram(groupby="group").encode(x="value", color="group")

  • displot (KDE)


    displot_kde

    helper: fm.displot(df, x="value", hue="group", kind="kde")

    grammar: fm.Chart(df).mark_density(groupby="group").encode(x="value", color="group")

  • displot (ECDF)


    displot_ecdf

    helper: fm.displot(df, x="value", kind="ecdf")

  • catplot (box)


    catplot_box

    helper: fm.catplot(df, x="group", y="value", kind="box")

    grammar: fm.Chart(df).mark_boxplot().encode(x="group", y="value")

  • catplot (violin)


    catplot_violin

    helper: fm.catplot(df, x="group", y="value", kind="violin")

    grammar: fm.Chart(df).mark_violin().encode(x="group", y="value")

  • catplot (strip)


    catplot_strip

    helper: fm.catplot(df, x="group", y="value", kind="strip")

    grammar: fm.Chart(df).mark_point().encode(x="group", y="value")

  • lmplot


    lmplot

    helper: fm.lmplot(df, x="x", y="y", hue="group")

    grammar: fm.Chart(df).mark_point().encode(...) + fm.Chart(df).mark_smooth(method="lm")

  • residplot


    residplot

    helper: fm.residplot(df, x="x", y="y")

    grammar: fm.Chart(df).mark_smooth(method="lm", inject_residuals=True).encode(x="x", y="residual")

  • pairplot


    pairplot

    helper: fm.pairplot(df, vars=[...], hue="species")

    grammar: fm.RepeatChart(template, row=[...], column=[...])

  • jointplot


    jointplot

    helper: fm.jointplot(df, x="sepal_length", y="sepal_width")

    grammar: fm.JointChart(center, top=marginal)

  • heatmap


    heatmap

    helper: fm.heatmap(df_corr, center=0, annot=True)

    grammar: fm.Chart(df).mark_rect().encode(x="col", y="row", color="value")

  • clustermap


    clustermap

    helper: fm.clustermap(df_cluster)

    grammar: fm.ClusterMapChart(heatmap, row_dendrogram, col_dendrogram)

Model diagnostics

Classification, regression, feature explanation, model selection, and clustering — all as charts.

  • ROC curve


    roc_chart

    fm.roc_chart(model, X_test, y_test)

  • Precision-recall


    pr_chart

    fm.pr_chart(model, X_test, y_test)

  • Confusion matrix


    confusion_matrix_chart

    fm.confusion_matrix_chart(model, X_test, y_test)

  • Class prediction error


    class_prediction_error

    fm.class_prediction_error_chart(model, X_test, y_test)

  • Discrimination threshold


    discrimination_threshold

    fm.discrimination_threshold_chart(model, X_test, y_test)

  • Gain chart


    gain_chart

    fm.gain_chart(model, X_test, y_test)

  • Lift chart


    lift_chart

    fm.lift_chart(model, X_test, y_test)

  • Feature importance


    importance_chart

    fm.importance_chart(model, X_test, y_test)

  • SHAP beeswarm


    shap_beeswarm_chart

    fm.shap_beeswarm_chart(model, X, y)

  • SHAP bar


    shap_bar_chart

    fm.shap_bar_chart(model, X, y)

  • Partial dependence


    pdp_chart

    fm.pdp_chart(model, X, y, features=[0, 1])

  • Residuals


    residuals_chart

    fm.residuals_chart(model, X, y)

  • Prediction error


    prediction_error_chart

    fm.Chart(source.predictions()).mark_prediction_error()

  • Learning curve


    learning_curve_chart

    fm.learning_curve_chart(model, X, y, cv=3)

  • Validation curve


    validation_curve_chart

    fm.validation_curve_chart(Ridge(), X, y, param="alpha", values=[...])

  • CV scores


    cv_scores_chart

    fm.cv_scores_chart(model, X, y, cv=5)

  • Calibration


    calibration_chart

    fm.calibration_chart(model, X, y)

  • Alpha selection


    alpha_selection_chart

    fm.alpha_selection_chart(Ridge(), X, y, alphas=[...])

  • Decision boundary


    decision_boundary_chart

    fm.decision_boundary_chart(model, X, y, features=(0, 1))

  • Silhouette / cluster diagnostics


    cluster_diagnostics

    fm.cluster_diagnostics(X, ks=range(2, 7))

  • Intercluster distance


    intercluster_distance_chart

    fm.intercluster_distance_chart(km, X)

  • PCA scree


    pca_scree_chart

    fm.pca_scree_chart(pca, X)

Ferrum theme identities

Three original theme identities ship with Ferrum. Each pairs a background, typography, mark palette, and color schemes into a cohesive look.

Paper Ink (default)

Warm cream background, blue lead marks, perceptually balanced categorical cycle.

  • scatter_paper_ink

  • bar_paper_ink

  • heatmap_paper_ink

Slate Citrus

Dark navy background, vibrant neon accents, lime/cyan categorical cycle.

  • scatter_slate_citrus

  • bar_slate_citrus

  • heatmap_slate_citrus

Arctic Signal

Cool white background, sky blue lead mark, precise signal palette.

  • scatter_arctic_signal

  • bar_arctic_signal

  • heatmap_arctic_signal

See the full Themes guide for the complete list of twelve built-in themes and how to build your own.