arundo / adtk

A Python toolkit for rule-based/unsupervised anomaly detection in time series
https://adtk.readthedocs.io
Mozilla Public License 2.0
1.09k stars 145 forks source link

Plots don't show up #81

Closed chaizeg closed 4 years ago

chaizeg commented 4 years ago

Hi, I can't seem to show the plots made by adtk.visualization, and I don't know why. Here's my code : ` import pandas as pd from adtk.detector import ThresholdAD from adtk.data import validate_series from adtk.visualization import plot

s = pd.read_csv('../STL/airline-passengers.csv', index_col="Month", parse_dates=True, squeeze=True) s = validate_series(s) threshold_ad = ThresholdAD(high=30, low=15) anomalies = threshold_ad.fit_detect(s) plot(s, anomaly_pred=anomalies, ts_linewidth=2, ts_markersize=3, ap_markersize=5, ap_color='red', ap_marker_on_curve=True) ` Thanks for your help :)

vpiduri commented 4 years ago

Hi @chaizeg How did you solve this issue. I have similar issue on mac, I can see AxesSubplot object printed on console but I don't see the plot

from adtk.data import validate_series s_train = validate_series(s_train) print(s_train) timestamp 2015-07-10 14:24:00 564 2015-07-10 14:38:00 730 2015-07-10 14:48:00 770 2015-07-10 15:03:00 910 2015-07-10 15:22:00 1035 ... 2015-09-17 16:34:00 385 2015-09-17 16:44:00 285 2015-09-17 16:50:00 271 2015-09-17 17:00:00 308 2015-09-17 17:10:00 305 Name: value, Length: 2500, dtype: int64 from adtk.visualization import plot plot(s_train) [<matplotlib.axes._subplots.AxesSubplot object at 0x1208572b0>]