title: Adding key/legend to histogram
body: <p>I have not been able to add a legend to my histogram, created using matplotlib.pyplot.
  Would appreciate some help/advice. </p>
  
  <p>The below dataset is junk data, but is an accurate example of the situation, two datasets, both in the same dataframe, seperated by a filter on a column.</p>
  
  <pre><code>import numpy as np
  import matplotlib.pyplot as plt
  import pandas as pd
  import math
  import pyodbc
  import re
  
  
  data = [{ 'uid':1,'Region':'nebraska', 'metric1':24},
          { 'uid':2,'Region':'nebraska', 'metric1':12},
          { 'uid':3,'Region':'nebraska', 'metric1':23},
          { 'uid':4,'Region':'nebraska', 'metric1':12},
          { 'uid':1,'Region':'nebraska', 'metric1':24},
          { 'uid':2,'Region':'nebraska', 'metric1':12},
          { 'uid':3,'Region':'nebraska', 'metric1':23},
          { 'uid':4,'Region':'nebraska', 'metric1':12},
          { 'uid':1,'Region':'nebraska', 'metric1':24},
          { 'uid':2,'Region':'nebraska', 'metric1':12},
          { 'uid':3,'Region':'nebraska', 'metric1':23},
          { 'uid':4,'Region':'nebraska', 'metric1':12},
          { 'uid':1,'Region':'nebraska', 'metric1':24},
          { 'uid':2,'Region':'nebraska', 'metric1':12},
          { 'uid':3,'Region':'nebraska', 'metric1':23},
          { 'uid':4,'Region':'nebraska', 'metric1':12},
          { 'uid':29,'Region':'colorado', 'metric1':14},
          { 'uid':30,'Region':'colorado', 'metric1':45},
          { 'uid':30,'Region':'colorado', 'metric1':45},
          { 'uid':30,'Region':'colorado', 'metric1':45},
          { 'uid':31,'Region':'colorado', 'metric1':65},
          { 'uid':32,'Region':'colorado', 'metric1':50}
          ]
  
  testDataset = pd.DataFrame(data)
  
  b = np.arange(0,100, 50)
  
  
  plt.hist(testDataset[testDataset['Region'] == 'nebraska']['metric1'], b,color = 'red')   
  plt.xticks(rotation=90)
  plt.xticks(np.arange(0, 100, 10))
  plt.yticks(np.arange(0, 100, 10))
  plt.grid(zorder=0)
  
  
  plt.hist(testDataset[testDataset['Region'] == 'colorado']['metric1'], b,color = 'blue')   
  
  plt.show()
  </code></pre>