title: Matplotlib streamplot varying color
body: <p>I intend to make a streamlines plot with varying color indicating the intensity at different points with a 2D array. u,v representing the wind components at different points.</p>
  <p>Code:</p>
  <pre><code>x = np.linspace(71.679886,100.43091,299) ##longitude
  y = np.linspace(10.64794,31.228256,231)  ##latitude
  level = [0,5]
  for t in level:  ##t is level in output
      U = u[t,:,:]
      V = v[t,:,:]
      f = X[t,:,:]
      SPD = sqrt(u**2+v**2)
      print(SPD)
      pyplot.streamplot(x,y,u,v,density=5,arrowsize=1,integration_direction='forward',color=SPD,cmap=&quot;autumn&quot;,linewidth=2)
      pyplot.show()
  </code></pre>
  <p>The output should look similar to this:
  <a href="https://i.stack.imgur.com/bWRAc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bWRAc.png" alt="enter image description here" /></a></p>
  <p><a href="https://matplotlib.org/3.3.1/api/_as_gen/matplotlib.axes.Axes.streamplot.html#matplotlib.axes.Axes.streamplot" rel="nofollow noreferrer">Link</a> shows that such plots can be made with specifying a 2D array with <code>color</code>, but I get the error: <code>ValueError: RGBA sequence should have length 3 or 4</code>, if I use a 2D array, <code>color=SPD</code>.
  Kindly help.</p>