MCPcopy Index your code
hub / github.com/statsmodels/statsmodels / add_stl_plot

Function add_stl_plot

examples/python/stl_decomposition.py:429–440  ·  view source on GitHub ↗

Add 3 plots from a second STL fit

(fig, res, legend)

Source from the content-addressed store, hash-verified

427
428
429def add_stl_plot(fig, res, legend):
430 """Add 3 plots from a second STL fit"""
431 axs = fig.get_axes()
432 comps = ["trend", "seasonal", "resid"]
433 for ax, comp in zip(axs[1:], comps):
434 series = getattr(res, comp)
435 if comp == "resid":
436 ax.plot(series, marker="o", linestyle="none")
437 else:
438 ax.plot(series)
439 if comp == "trend":
440 ax.legend(legend, frameon=False)
441
442
443stl = STL(elec_equip, period=12, robust=True)

Callers 1

Calls 1

plotMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…