Suppose I have dataframe, which has index composed of two columns and I want to plot it:
import pandas
from matplotlib import pyplot as plot
df=pandas.DataFrame(data={'floor':[1,1,1,2,2,2,3,3],'room':[1,2,3,1,1,2,1,3],'count':[1, 1, 3,2,2,4,1,5]})
df2=df.groupby(['floor','room']).sum()
df2.plot()
plot.show()
The above example will result in a plot where row numbers are used for x axis and no tick labels. Are there any facilities to use the index instead?
Say, I'd like to have x axis separated into even sections for first column of index and spread out points values of second index column inside those sections.