text: I did a post on Pandas and plotting. In that post, Matplotlib was used from Pandas. In this post, I will show a simple bar chart in Matplotlib- sans Pandas.
  Here is the code:
  import matplotlib.pylab as plt
  fig = plt.figure() #create a figure
  ax = fig.add_subplot(1,1,1) # add plot
  x = [2,4,6,8] #x axis value
  y = [4,8,12,16] #Y axis: height
  ax.bar(x,y, align=’center’, color=’green’) #required ax.bar(x,y)
  fig.savefig(‘paul2.jpg’) #This saves a file
  #plt.show() This shows it on the screen and gives you the option to save.
  That’s it. I like centering my bars, but leave the options out and it will align the left corner with the value of X. Don’t forget a title – I did. Put fig.suptitle(‘Sample With YERR=2′, fontsize=14, fontweight=’bold’) before adding the subplot. And lastly I like to add the error bars using ax.bar(x,y, yerr=2, align=’center’, color=’green’). The result looks like this:
  UPDATE: I hate that the bars go to the top of the chart. fix that by setting the Y Limit. Drop this line in your code: p.ylim(2,20)