title: ValueError: too many values to unpack (expected 1)?
body: <p>I keep getting the "<em>ValueError: too many values to unpack (expected 1)</em>"</p>
  
  <p>It says the error occurs at <code>p2, = plt.plot(t, p, 'g--', label='Approx')</code>, but I do not see a problem with that line. How do I fix it?</p>
  
  <pre><code>def g(x):
      return x * np.sin(1/x)
  
  x = np.linspace(-1, 1, 30)
  y = g(x)
  t = np.linspace(np.min(x), np.max(x), 100)
  p = np.array([g(x) for i in range(len(t))])
  xx = np.linspace(np.min(x), np.max(x), 100)
  yy = g(xx)
  plt.figure(1)
  p1, = plt.plot(x, y, 'ro', label='Data points')
  p2, = plt.plot(t, p, 'g--', label='Approx')
  p3, = plt.plot(xx, yy, 'blue', label='Real')
  plt.legend(handles=[p1, p2, p3], loc='best')
  plt.xlabel('t')
  plt.ylabel('g(x)')
  plt.grid(True)
  plt.show()
  </code></pre>