title: How to plot multi-color line if x-axis is date time index of pandas
body: <p>I am trying to plot a multi-color line using pandas series. I know <code>matplotlib.collections.LineCollection</code> will sharply promote the efficiency.
  But LineCollection require line segments must be float. I want to use datatime index of pandas as x-axis.</p>
  
  <pre><code>points = np.array((np.array[df_index.astype('float'), values]).T.reshape(-1,1,2))
  segments = np.concatenate([points[:-1],points[1:]], axis=1)
  lc = LineCollection(segments)
  fig = plt.figure()
  plt.gca().add_collection(lc)
  plt.show()
  </code></pre>
  
  <p>But the picture can't make me satisfied.
  Is there any solution?</p>