Skip to main content
Ctrl+K
Part of the numeraire ecosystem.

numeraire-graphics 0.1.0

  • Installation
  • Gallery
  • API reference
  • Changelog
  • numeraire
  • dataset
  • GitHub
  • PyPI
  • Installation
  • Gallery
  • API reference
  • Changelog
  • numeraire
  • dataset
  • GitHub
  • PyPI

Section Navigation

  • Gallery

Gallery#

Every figure, grouped by the input family it consumes. Each is a pure function returning a ggplot; compose it with theme_numeraire() and a colour scale, then render or save.

Family A — result-schema plotters#

These read the tidy result table every evaluator emits — one row per method × date × metric. Per-date rows (e.g. StrategyReturnEvaluator’s strategy_return) feed the time-series plots; summary rows (e.g. sharpe) feed the bar and curve plots.

plot_cumulative

Geometric wealth curve with a drawdown facet, an optional benchmark line and recession shading.

plot_cumulative(results, benchmark=None, recessions=None)
plot_rolling

Trailing-window rolling Sharpe, mean, or volatility — one line per method.

plot_rolling(results, window=36, metric="sharpe")
plot_metric_by

A summary metric as bars across a grouping column, with confidence-interval whiskers when derivable.

plot_metric_by(results, metric="sharpe", x="method")
plot_complexity_curve

A metric plotted against a caller-supplied complexity axis (shrinkage intensity, parameter count).

plot_complexity_curve(results, x="n_params", metric="oos_r2", ribbon=None)
plot_ic_decay

Information-coefficient decay by horizon, from ICEvaluator rows joined to a numeric horizon.

plot_ic_decay(results, horizon="horizon", metric="ic", smooth=False)

Family B — Output / frame plotters#

These need inputs the tidy schema does not carry, so they take a numeraire Output object or a caller-supplied frame directly.

plot_weights_heatmap

A date × asset weight matrix as geom_tile, signed long/short, from a WeightsOutput object.

plot_weights_heatmap(weights_output, top=None, order="mean")
plot_factor_loadings

Loading paths over an axis, or a loadings heatmap, from a caller-supplied tidy loadings frame.

plot_factor_loadings(loadings, x="date")
plot_frontier

A risk–return efficient frontier, optionally overlaying named portfolios, from a risk/return frame.

plot_frontier(frontier, points=None)

Helpers#

theme_numeraire

The publication house theme (serif, flat strips, y-only grid) — compose it onto any figure.

fig + theme_numeraire(base_size=8)
scale_color_numeraire / scale_fill_numeraire

Colourblind-safe Okabe–Ito discrete scales; the fill scale also offers a zero-centred diverging mode for the signed weights heatmap.

fig + scale_color_numeraire()
fig + scale_fill_numeraire(diverging=True)
save_paper

The sole save surface — sizes the figure exactly in centimetres under a print font profile.

save_paper(fig, "figure.pdf", width_cm=8, height_cm=6)
mean_variance_frontier

A small numpy-only convenience that traces a risk/return frame from a mean vector and covariance for plot_frontier.

frontier = mean_variance_frontier(mean, cov, n=50)

previous

Installation

next

API reference

On this page
  • Family A — result-schema plotters
  • Family B — Output / frame plotters
  • Helpers
Show Source

© Copyright 2026, Yuheng Wu.

Created using Sphinx 9.1.0.

Built with the PyData Sphinx Theme 0.19.0.