adtk icon indicating copy to clipboard operation
adtk copied to clipboard

adtk.visualization.plot can't work

Open MorpheusPoi opened this issue 5 years ago • 6 comments

Hello,

I am new learner to ADTK and trying to run sample codes bellow:

import pandas as pd from adtk.visualization import plot from adtk.data import validate_series

df = pd.read_csv("E:/Codes/python/Book1.csv", index_col="TestTime", parse_dates=True, squeeze=True) GP1_train = df["GP1"] GP1_train = validate_series(GP1_train) print(GP1_train) plot(GP1_train)

I thought it will pop out a graph but there is no graph after the code exicuted without any error reported. I am not sure what is the problem and hopes anyone can help on this issue. Thanks very much for your help.

MorpheusPoi avatar Aug 01 '20 16:08 MorpheusPoi

Are your running this in jupyter notebook? If so, you may need %matplotlib inline.

tailaiw avatar Aug 13 '20 00:08 tailaiw

Are your running this in jupyter notebook? If so, you may need %matplotlib inline.

Thanks for your help. I tried VS code and PyCharm and both failed to present a chart. Also I tried in other computer but still can't get a chart. Also I tried to use matplotlib to plot a chart and it can generate a chart as expect.

MorpheusPoi avatar Aug 13 '20 00:08 MorpheusPoi

I experienced the same issue, running from the terminal. I resolved it by adding a call to pyplot show after my adtk plots. ... import matplotlib.pyplot as plt ... plt.show() ... I am new to adtk, not sure if this was an intended change. But I actually prefer to be able to decide when to show my plots :)

sbriseid avatar Aug 14 '20 09:08 sbriseid

@sbriseid That's exactly the design :) The plot function returns matplotlib figure and axes objects and users may decide when and how to show plots by themselves (e.g. plt.show() or %matplotlib inline in notebook)

tailaiw avatar Aug 14 '20 13:08 tailaiw

@sbriseid your method works. @tailaiw, @sbriseid, thanks very much for your help.

MorpheusPoi avatar Aug 18 '20 03:08 MorpheusPoi

today i meet the same problem,and @sbriseid help me resolve it quickly,thanks

JohnRothan avatar Apr 08 '23 15:04 JohnRothan