Add 3 plots from a second STL fit
(fig, res, legend)
| 427 | |
| 428 | |
| 429 | def 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 | |
| 443 | stl = STL(elec_equip, period=12, robust=True) |
no test coverage detected
searching dependent graphs…