Plotting Pandas Data As An Array Of Bar Chart Does Not Honour Sharex = True
I have a Pandas dataframe that contains a column containing 'year' data and a column containing 'count' data. There is also a column containing a 'category' variable. Not each cate
Solution 1:
Try the following approach:
d = myDF.groupby(['year', 'category'])['count'].sum().unstack()
fig, axarr = plt.subplots(3, figsize = (4,6), sharex=True)
for i, cat in enumerate(d.columns):
d[cat].plot(kind='bar', ax=axarr[i], title='Category {cat} bar chart'.format(cat=cat))
fig.subplots_adjust(hspace=0.5)
Post a Comment for "Plotting Pandas Data As An Array Of Bar Chart Does Not Honour Sharex = True"