I have a pandas time indexed pandas dataframe called small_roll_changepoint looks like following
roll changepoint
index
t1 1.1 0
t2 1.2 0
t3 0.1 0
t4 12 1
t5 11 0
changepoint columns is either 0 and 1, which marks the changepoint on time series roll. The exact visualization I want to achieve is to segment the roll series where changepoint is 1
codes I can come up to
fig, ax = pl.subplots()
fig.set_size_inches(18.5,10.5)
small_roll_changepoint.plot(style=['-',':'],ax=ax)
pl.show()
it's ugly
I'm not sure how to achieve your desired visualization, but one way to "pretty up" the graph a little bit is to add the following line.
pd.set_option('display.mpl_style', 'default')
and replace
fig.set_size_inches(18.5,10.5)
with
pl.rcParams['figure.figsize'] = (18.5,10.5)
This will definitely make the matplotlib
graph look much more presentable.
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加