code: def draw_bar_chart():
      
      N = 5
      menMeans = (20, 35, 30, 35, 27)
      menStd = (2, 3, 4, 1, 2)
  
      ind = numpy.arange(N)
      width = 0.35
  
      fig = pyplot.figure()
      ax = fig.add_subplot(111)
      rects1 = ax.bar(ind, menMeans, width, color='r', yerr=menStd)
  
      womenMeans = (25, 32, 34, 20, 25)
      womenStd = (3, 5, 2, 3, 3)
      rects2 = ax.bar(ind+width, womenMeans, width, color='y', yerr=womenStd)
  
      ax.set_ylabel('Scores')
      ax.set_title('Scores by group and color')
      ax.set_xticks(ind+width)
      ax.set_xticklabels(('G1', 'G2', 'G3', 'G4', 'G5'))
  
      ax.legend((rects1[0], rects2[0]), ('Red', 'Yellow'))
  
      def autolabel(rects):
          for rect in rects:
              height = rect.get_height()
              ax.text(rect.get_x()+rect.get_width()/2., 1.05*height, '%d' % int(height),
                      ha='center', va='bottom')
  
      autolabel(rects1)
      autolabel(rects2)
      pyplot.savefig(bars_filename)
docs: Uses sample code from http://matplotlib.org/1.2.1/examples/api/barchart_demo.html