numeraire-graphics#

Publication-ready, grammar-of-graphics figures for the numeraire research framework. Every plot is a pure function (results, *, ...) -> ggplot built with plotnine: it consumes the tidy result schema every evaluator emits, or an engine Output object such as a WeightsOutput, and returns a grammar object. It never draws or saves for you — you compose the result freely and render it yourself, so the figure stays a value you can theme, facet, or hand to the one explicit save surface.

from numeraire_graphics import plot_cumulative, theme_numeraire, save_paper

fig = plot_cumulative(results) + theme_numeraire()
save_paper(fig, "wealth.pdf", width_cm=8, height_cm=6)   # centimetre-exact, print-ready

Two input families#

The plots divide by what they consume. Result-schema plotters read the tidy result table (one row per method × date × metric) — the default surface for comparison figures assembled straight from a run. Output/frame plotters need richer inputs the tidy schema does not carry — a per-date × asset weight stream, a loadings panel, a frontier trace — so they take a numeraire Output object (a WeightsOutput) or a caller-supplied frame directly. The contract is identical either way: return a ggplot, never draw or save. See the Gallery for every figure.

Where to go next#

  • Installation — install and the optional extras.

  • Gallery — every figure, grouped by input family, with the call that produces it.

  • API reference — the full API reference.