python - Plotting Pandas Time Data -


my data pandas dataframe called 't':

                b  c date                   2001-11-13  30.1  2  3 2007-02-23  12.0  1  7 

the result of t.index

<class 'pandas.tseries.index.datetimeindex'> [2001-11-13, 2007-02-23] length: 2, freq: none, timezone: none 

so know index time series. when plot using ax.plot(t) don't times series on x axis!

i ever have 2 data points how dates in graph (i.e. 2 dates @ either end of x axis)?

not time series graph

use implemented pandas command:

in[211]: df2 out[211]:                  b  c 1970-01-01  30.1  2  3 1980-01-01  12.0  1  7 in[212]: df2.plot() out[212]: <matplotlib.axes.axessubplot @ 0x105224e0> in[213]: plt.show() 

you can access axis using

ax = df2.plot() 

enter image description here


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -