Plot Time Series Dataframe And Mark Certain Points Using Pandas And Matplotlib
I have a dataframe storing a time series, which looks like as follows. How to plot it using time column as x-axis. Moreover, if I want to mark certain points between a given time p
Solution 1:
the easiest way to do this is to plot twice, the second plot having the extra style. Regarding the plot size, you can control the figsize
parameter. Just set a tuple with the height and width you like
# make sure index is in datetime format
df_id_ts.index = pd.to_datetime(df_id_ts.index, figsize=(10,6))
ax = df_id_ts.plot()
df_id_ts['2014-11-18' : '2015-01-30'].plot(ax = ax, marker = 'ro')
Post a Comment for "Plot Time Series Dataframe And Mark Certain Points Using Pandas And Matplotlib"