numeraire_graphics.plot_factor_loadings#

numeraire_graphics.plot_factor_loadings(loadings: DataFrame, *, x: str | None = None, series: str | None = None, diverging: bool = True) plotnine.ggplot[source]#

Factor-loading paths over an axis, or a loadings heatmap when no axis is given.

There is no standard core loadings surface — a loadings object is method-local (an IPCA Gamma, a rolling-beta panel), so this family-B plotter takes a caller-supplied tidy frame with columns factor, loading and an axis (date and/or entity); a frame lacking factor or loading raises.

With x given (a date for a time path, a characteristic column for a cross-sectional profile) the loadings are drawn as geom_line + geom_point paths coloured and facetted by factor. With x=None the frame is shown as a loadings heatmap — factor on the y-axis, the first present of entity/date on the x-axis, loading as the (diverging) fill — the natural view of a static factor x characteristic matrix. The heatmap uses a zero-centred diverging fill by default; pass diverging=False to supply a scale yourself.

For paths, series names the column whose entities form separate lines. When omitted and an entity column is present (and is not itself the x-axis), it is selected automatically so separate firms/characteristics are never connected into one artificial path.