title: How to color different segments of plotted curve based on value? [python]
body: <p>I am trying to figure out how to plot a dataframe column where the color of the line changes based on its value, but I am stuck on how to get these values referenced.</p>
  <p>For example, I have this dataframe:</p>
  <pre><code>    Timestamp    Value
  -------------------------
  0       5:00         4
  1       5:01         5
  2       5:02         8
  3       5:03        12
  4       5:04        13
  5       5:05         2
  ...
  </code></pre>
  <p>I simple run some form of:</p>
  <pre><code>df.plot(x=&quot;Timestamp&quot;, y=[&quot;Value&quot;], figsize=(9, 8)) 
  </code></pre>
  <p>to get a plot of the values changing over time.</p>
  <p>Now, I have my values separated into different categories/bins, where: 0-5 = &quot;Low&quot;, 6-15 = &quot;Mid&quot; and 16+ = &quot;High&quot;. I want to have my same plot, but now with all values on the curve corresponding to &quot;Low&quot; to be blue, corresponding to &quot;Mid&quot; to be green, and corresponding to &quot;High&quot; to be red. So I will see see a single curve plotted, made up from the &quot;Value&quot; column, but segmented into different colors based on value. How can I accomplish this in python? I am confused about how to set up an index/key for translating values to colors and what argument is needed in .plot() to actually have color based on value.</p>