title: Changing chart column color based off data
body: <p>I have a python script that parses a csv file and creates a mixed chart from it. </p>
  
  <p>If the Current Progress has dropped since the Previous Progress by more than 5, I would like to change the color of the CurrentProg bar to red. Is it possible to do this? </p>
  
  <p>For example, the table below is a sample of the csv file that I am parsing. I would like CurrentProg bar for Derick and Lisa to be red as shown in the graph below it.</p>
  
  <blockquote>
    <p>Name  &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;  OldProg &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;    PrevProg    &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;   CurrentProg&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; Goal<br>
    Derick &nbsp;   &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;   45   &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;    &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;    60          &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;   52  &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;   90<br>
    Jenna       &nbsp;   &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;   56   &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;    &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;    87          &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;   89  &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;   90<br>
    Lisa&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;   78   &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;    &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;    93          &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;   76  &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;   90<br>
    Harry &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;   98  &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;    &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;    84          &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;   79  &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;   90<br></p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/ePl5M.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ePl5M.png" alt="enter image description here"></a></p>
  
  <p>Here is a snippet of the code that parses the csv file and puts them into a bars/lines for the chart. </p>
  
  <pre><code>import pandas as pd
  import matplotlib.pyplot as plt
  import numpy as np
  
  df = pd.read_csv("file.csv")
  names = df['name'].values
  x = np.arange(len(names))*2
  w = 0.40
  plt.bar(x-w, df['Old Progress'].values, width=w*0.7, label='OldProg', color = "cyan")
  plt.bar(x, df['Previous Progress'].values, width=w*0.7, label='PrevProg', color = "green")
  plt.bar(x+w, df['Current Progress'].values, width=w*0.7, label='CurrentProg', color = "blue")
  plt.plot(x, df['Goal'].values, lw=2, label='Goal', color = "red")
  </code></pre>
  
  <p>Please let me know if I need to clarify anything further. Thank you.</p>