title: Year over year matplotlib with legend
body: <p>I'm trying to mimic this graph from Excel
  <a href="https://i.stack.imgur.com/P2WLQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/P2WLQ.png" alt="enter image description here"></a> in python and matplotlib.</p>
  
  <p>The dataframe (by_year) looks below with a multiindex of
  EDIT - Changed table to reflect that the rows are different</p>
  
  <pre><code>Month 1   2   3   4   5   6   7   8   9   10   11   12
  Year
  2012  8   6   8   9   1   2   8   9   4   3    2    6
  2013  5   6   2   9   6   2   8   9   4   3    2    6
  2014  7   6   3   9   4   2   8   9   4   3    2    6
  
  # create multiple plots on the page (i'm going to print this rather
  # than display live
  ax1 = plt.subplot2grid((3, 2), (0,0), colspan=2)
  ax2 = plt.subplot2grid((3, 2), (1,0))
  
  # loop through the years (each row) and add to chart
  for idx, row in by_year.iterrows():
      row_values = row.values.astype(int).tolist()
      ax1.bar(month_list, row_values)
      ax1.legend(str(idx))
  </code></pre>
  
  <p>Problem 1 - This runs with no errors, however i only get a single set of bars. Don't understand how to fix this. Graph looks like this:
  <a href="https://i.stack.imgur.com/oonbr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oonbr.png" alt="enter image description here"></a></p>
  
  <p>EDIT - Problem is in the ax1.bar(month_list... line. It uses the same starting point for each row and hence the bars are on top of each other. The solution below by @GWW calculates the start position using idx. Which i would really name bar_start.</p>
  
  <p>Problem 2 - I can't find anywhere how to add that legend with the data under the table. I can try and create by simply displaying the dataframe (i think :) ) but does Matplotlib already have the functionality?</p>