title: Change color of 2D plot line depending on 3rd value
body: <p>I have a data set that looks like this</p>
  
  <pre><code> 140400 70.7850 1
   140401 70.7923 2
   140402 70.7993 3
   140403 70.8067 4
   140404 70.8139 5
   140405 70.8212 3
  </code></pre>
  
  <p>Where the first column corresponds to time (one second intervals between data points) and will be on the x axis, the second column corresponds with distance and will be on the y axis. The third column is a number (one through five) that is a qualification of the movement.</p>
  
  <p>I want to make a plot that changes the color of the line between two points depending on what the number of the previous data point was. For example, I want the line to be red between the first and second data points because the qualification value was 1. </p>
  
  <p>I've seen a lot of posts about making a sliding scale of colors depending on an intensity value, but I just want 5 colors: (red, orange, yellow, green, and blue) respectively.</p>
  
  <p>I tried doing something like this:</p>
  
  <pre><code>plot(x,y,{'r','o','y','g','b'})
  </code></pre>
  
  <p>But with no luck.</p>
  
  <p>Any ideas of how to approach this? Without looping if possible.</p>