title: Stop matplotlib repeating labels in legend
body: <p>Here is a very simplified example:</p>
  <pre><code>xvalues = [2,3,4,6]
  
  for x in xvalues:
      plt.axvline(x,color='b',label='xvalues')
  
  plt.legend()
  </code></pre>
  <p><a href="https://i.stack.imgur.com/aO6jN.png" rel="noreferrer"><img src="https://i.stack.imgur.com/aO6jN.png" alt="enter image description here" /></a></p>
  <p>The legend will now show 'xvalues' as a blue line 4 times in the legend.
  Is there a more elegant way of fixing this than the following?</p>
  <pre><code>for i,x in enumerate(xvalues):
      if not i:
          plt.axvline(x,color='b',label='xvalues')
      else:
          plt.axvline(x,color='b')
  </code></pre>
  <p><a href="https://i.stack.imgur.com/o535X.png" rel="noreferrer"><img src="https://i.stack.imgur.com/o535X.png" alt="enter image description here" /></a></p>