title: Generating custom legend (and only a legend) in matplotlib Python2
body: <p>I'm trying to make a custom legend using matplotlib.  The <a href="http://matplotlib.org/users/legend_guide.html#plotting-guide-legend" rel="nofollow noreferrer">example in the matplotlib documentation</a> doesn't work on my set up.  Neither does this follow.</p>
  
  <pre><code>from matplotlib import pyplot as plt
  import matplotlib.patches as mpatches
  
  fig, ax = plt.subplots()
  
  patch1 = mpatches.Patch(color='#a6cee3', label='Blue')
  patch2 = mpatches.Patch(color='#1f78b4', label='Bluerish')
  patch3 = mpatches.Patch(color='#33a02c', label='Greener')
  patch4 = mpatches.Patch(color='#fdbf6f', label='Kind of orange')
  patch5 = mpatches.Patch(color='#ff7f00', label='Orange')
  
  all_handles = (patch1, patch2, patch3, patch4, patch5)
  
  leg = ax.legend(all_handles)
  
  ax.add_artist(leg)
  plt.show()
  </code></pre>
  
  <p>How can I make it produce the desired legend?  </p>
  
  <p>I'm using Mac OSX 10.10.3, Python 2.7.6, Matplotlib 1.3.1.  </p>
  
  <p>Edit: @xnx's solution below works for Python 3, and works for Python 2.7.11 if using Matplotlib 2.1.1 (thanks @DavidG).  </p>