DecompositionPlots.contributions_over_time#

DecompositionPlots.contributions_over_time(include=None, hdi_prob=0.94, original_scale=True, facet=False, idata=None, dims=None, figsize=None, backend=None, return_as_pc=False, line_kwargs=None, hdi_kwargs=None, **pc_kwargs)[source]#

Plot time-series contributions for selected contribution types with HDI bands.

By default creates one panel per extra-dimension combination (e.g. one per geo for geo-segmented models), with each panel overlaying one mean line and HDI band per contribution type. Set facet=True to instead draw each contribution component in its own panel.

Parameters:
includelist of {“channels”, “baseline”, “controls”, “seasonality”}, optional

Which contribution types to plot. None means all available.

hdi_probfloat, default 0.94

Probability mass for the HDI band.

original_scalebool, default True

Whether to return contributions in original scale.

facetbool, default False

If True, draw each contribution component (e.g. each channel) in its own panel instead of overlaying all components in a single panel coloured by component. Faceting combines with any extra dims (e.g. geo), so the panel count is components x extra-dim combinations.

idataxr.DataTree, optional

Override instance data for this call only.

dimsdict[str, Any], optional

Subset dimensions, e.g. {"geo": ["CA"]}.

figsizetuple[float, float], optional

Injected into figure_kwargs.

backendstr, optional

Rendering backend. Non-matplotlib requires return_as_pc=True.

return_as_pcbool, default False

If True, return the PlotCollection instead of (Figure, NDArray[Axes]).

line_kwargsdict, optional

Extra kwargs forwarded to azp.visuals.line_xy for every mean line.

hdi_kwargsdict, optional

Extra kwargs forwarded to azp.visuals.fill_between_y for every HDI band.

**pc_kwargs

Forwarded to PlotCollection.wrap(). Use col_wrap to override the default single-column layout.

Returns:
tuple[Figure, NDArray[Axes]] or PlotCollection