I would like to plot multiple barplots on a row using the same ax, but it seems that the pandas
plot function removes my previous plot everytime.
For example :
import pandas as pd
import pylab as plt
fig, ax = plt.subplots()
df = pd.DataFrame({'lab':['D', 'E', 'F'], 'val':[10, 30, 20]})
df.plot.bar(x='lab', y='val', rot=0, ax=ax)
df = pd.DataFrame({'lab':['A', 'B', 'C'], 'val':[10, 30, 20]})
df.plot.bar(x='lab', y='val', rot=0, ax=ax)
ax.set_xlim(-.5, 6)
plt.show()
Give me
I tried to use the xticks
parameter of the pandas function but it didn't work.