title: How to "Colormap/Heatmap" Multiple Line Plots in Python (matplotlib)
body: <p>I am trying to plot multiple lines in space (each of which connect a pair of points) on one 3D graph in Python using matplotlib, and I want each line to be colored differently based on how long it is (i.e., the longest line would be red, a middle-length line would be orange-ish, etc.).  </p>
  
  <p>I have all of the line lengths computed.</p>
  
  <p>My points' coordinates are carried in separate arrays like so:</p>
  
  <pre><code>x1 = # all of the x coordinates of the primary points
  y1 = # all of the y coordinates of the primary points
  z1 = # all of the z coordinates of the primary points
  
  x2 = # all of the x coordinates of the secondary points
  y2 = # all of the y coordinates of the secondary points
  z2 = # all of the z coordinates of the secondary points
  </code></pre>
  
  <p>where each line has endpoints <code>(x1[i],y1[i],z1[i])</code> and <code>(x2[i],y2[i],z2[i])</code> and <code>i</code> is the index of the line.</p>
  
  <p>How might I use a heatmap or some other Python function to color each line accordingly?  I think I understand how heatmaps can be used to plot a set of data, but I am trying to plot separate lines and color them based on some reference length (i.e., <code>lenth_max</code>, which would be the "hottest" length).</p>