How to plot vertical and horizontal bars in different plots?



I am currently trying to plot a bar plot of a series in ipython notebook
data = Series(np.random.rand(16), index=list(‘abcdefghijklmnop’))
data.plot(kind=‘bar’, color=‘k’, alpha=0.7)
data.plot(kind=‘barh’, color=‘k’, alpha=0.7) ## for plotting horizontal

I want to know how to plot them in a different plot.


@sid100158 - You can plot them differently by using the subplot and by specifying the axis.

  fig, axes = plt.subplots(2, 1)
 data = Series(np.random.rand(16), index=list('abcdefghijklmnop'))
 data.plot(kind='bar', ax=axes[0], color='k', alpha=0.7)
 data.plot(kind='barh', ax=axes[1], color='k', alpha=0.7)

Hope this helps,