title: How do I assign multiple labels at once in matplotlib?
body: <p>I have the following dataset:</p>
  
  <pre><code>x = [0, 1, 2, 3, 4]
  y = [ [0, 1, 2, 3, 4],
        [5, 6, 7, 8, 9],
        [9, 8, 7, 6, 5] ]
  </code></pre>
  
  <p>Now I plot it with:</p>
  
  <pre><code>import matplotlib.pyplot as plt
  plt.plot(x, y)
  </code></pre>
  
  <p>However, I want to label the 3 y-datasets with this command, which raises an error when <code>.legend()</code> is called:</p>
  
  <pre><code>lineObjects = plt.plot(x, y, label=['foo', 'bar', 'baz'])
  plt.legend()
  
  File "./plot_nmos.py", line 33, in &lt;module&gt;
    plt.legend()
  ...
  AttributeError: 'list' object has no attribute 'startswith'
  </code></pre>
  
  <p>When I inspect the <code>lineObjects</code>:</p>
  
  <pre><code>&gt;&gt;&gt; lineObjects[0].get_label()
  ['foo', 'bar', 'baz']
  &gt;&gt;&gt; lineObjects[1].get_label()
  ['foo', 'bar', 'baz']
  &gt;&gt;&gt; lineObjects[2].get_label()
  ['foo', 'bar', 'baz']
  </code></pre>
  
  <h2>Question</h2>
  
  <p>Is there an elegant way to assign multiple labels by just using the <code>.plot()</code> method?</p>