facebookresearch / Kats

Kats, a kit to analyze time series data, a lightweight, easy-to-use, generalizable, and extendable framework to perform time series analysis, from understanding the key statistics and characteristics, detecting change points and anomalies, to forecasting future trends.
MIT License
4.88k stars 534 forks source link

Bug in plot decomposition.py #243

Closed dfbeltran closed 1 year ago

dfbeltran commented 2 years ago

When you try to plot (https://github.com/facebookresearch/Kats/blob/main/kats/utils/decomposition.py) it's overlapping the on the ax[0] the original data with the trend, this leaves an empty subplot. This is caused due to in the zip is not considered that it should start from ax[1] onwards

This logic should be reconsidered:

for part, ax, title in zip(parts, axs, titles):
    ts: TimeSeriesData = results[part]
    ax.plot(ts.time.values, ts.value.values, linewidth=linewidth)
    ax.set_title(title)
MoKazemi9 commented 2 years ago

@dfbeltran , thanks for the opening this issue, please feel free to submit a PR and the team will surely review it.

michaelbrundage commented 1 year ago

Thanks for the bug report. Fix pending.

michaelbrundage commented 1 year ago

Fixed in 48b6afb62f9ba334598b9e15f8b87b1a7b0daa4c