depictr.decompose_plot#

depictr.decompose_plot(x, period=None, model='additive', title=None)#

Seasonal decomposition as a stacked, facetted figure.

statsmodels’ seasonal_decompose splits the series into observed, trend, seasonal and residual components. The four are drawn in one figure, stacked in a single column with a free y-scale per component (facet_wrap on the component), so each is legible at its own magnitude.

Parameters:
  • x (pandas.Series or array-like) – The series. A datetime or period index sets the x-axis; otherwise the observation number is used.

  • period (int, optional) – Seasonal period. Inferred from a monthly/quarterly index when omitted.

  • model ({"additive", "multiplicative"}) – The decomposition model.

  • title (str, optional)

Return type:

plotnine.ggplot