Oct-03-2018, 08:33 PM
I'm trying to create horizontal and vertical bar plots. Below is my code. However, pressing "return" after the first plot command (line 3 of the code), all I get is the first output listed below. And after pressing "return" after the second plot command (line 4 of the code), I get the second output listed below. I do not get a graphical bar plot. I have imported everything I can think of: numpy, matplotlib.pyplot, pandas (i.e. things that I need to plot the graph as well as things I don't need) but horizonal and vertical bar plots are NOT being produced. Could someone help? I'm a complete newbie.
<matplotlib.axes._subplots.AxesSubplot at 0x2016a51ad30>
<matplotlib.axes._subplots.AxesSubplot at 0x2016a54e438>
fig, axes = plt.subplots(2,1) data = pd.Series(np.random.rand(16), index=list('abcdefghijklmnop')) data.plot.bar(ax=axes[0], color='k', alpha=0.7) data.plot.barh(ax=axes[1], color='k', alpha=0.7)Output received:
<matplotlib.axes._subplots.AxesSubplot at 0x2016a51ad30>
<matplotlib.axes._subplots.AxesSubplot at 0x2016a54e438>