pandas.DataFrame.plot is a convenient method for plotting data from dataframes. However, I don't understand how to format the axes using this method. For example,
import pandas as pd
import datetime
df = pd.DataFrame(index = [datetime.datetime(2016, 7, 2, 0, 0),
datetime.datetime(2016, 8, 6, 0, 0),
datetime.datetime(2016, 9, 13, 0, 0),
datetime.datetime(2016, 10, 26, 0, 0),
datetime.datetime(2016, 11, 2, 0, 0)],
data = {'total' : [5, 3, 1, 0, 2]})
df
Output
total
2016-07-02 5
2016-08-06 3
2016-09-13 1
2016-10-26 0
2016-11-02 2
Now plotting with the pandas plot method:
df.plot(kind='bar')
I would prefer that the x-axis just have the labels as the three-letter format of month - Jul Aug Sep Oct Nov.
Is this possible with the pandas plot method or should I build a chart with matplotlib instead?


