title: Python - color a 3d line plot
body: <p>I have a 3d line plot of the solar spectrum, which I plotted using the command,</p>
  
  <pre><code>from mpl_toolkits.mplot3d.axes3d import Axes3D
  from matplotlib.collections import PolyCollection, LineCollection
  from matplotlib.colors import colorConverter, ListedColormap, BoundaryNorm
  import matplotlib.cm as cm
  
  fig = plt.figure(figsize(15, 8))
  ax = fig.gca(projection='3d')
  
  x = SpectrumDF['Wavelength']
  z = SpectrumDF['DNI']
  y = SpectrumDF['TESTNUM']
  
  ax.plot(x, y, z)
  ax.set_xlabel('Wavelength')
  ax.set_ylabel('Test Number')
  ax.set_zlabel('Intensity')
  </code></pre>
  
  <p>The resultant plot is solid blue and takes whichever individual color I give in the function: plot( ). </p>
  
  <p>I have been trying to create a color gradient along the z-axis, intensity, without any success.</p>
  
  <p>I have around 500 test numbers, each has 744 data points.  </p>
  
  <p>Thank you for the help!</p>
  
  <p>This wouldn't let me post images because I don't have enough reputation. Anyway, here's the link to the plot I get using this code <a href="https://plus.google.com/106871046257785761571/posts/fMYsDF5wAQa" rel="nofollow noreferrer">https://plus.google.com/106871046257785761571/posts/fMYsDF5wAQa</a></p>
  
  <p><img src="https://i.stack.imgur.com/0Avfs.png" alt="enter image description here"></p>