title: How to plot in different colors in Matplotlib
body: <p>I'm new to Matplotlib. I have the position of a person every second, and I am trying to make a graph showing this. I have managed to show it, but now I would like it to display different colors according to their speed. So, I need the plt.plot() color to depend on the distance between each pair of points, instead of being always the same.
  This is what I have right now:</p>
  
  <pre><code>x = [i[0] for i in walk]
  y = [i[1] for i in walk]
  plt.clf()
  fig = plt.gcf()
  plt.axis([0, 391, 0, 578])
  im = plt.imread('field.png')
  cancha = plt.imshow(im)
  plt.plot(x,y)
  plt.axis('off')
  plt.savefig( IMG_DIR + 'match.png',bbox_inches='tight')
  plt.clf()
  </code></pre>
  
  <p>I would like to add some variable that defines the color according to distance([x[i],y[i]],[x[j],y[j]])</p>
  
  <p>Does anyone know how to do this?</p>
  
  <p>Thanks!</p>