title: Matplotlib different colors for bar graph based on value
body: <p>I'm plotting returns for sectors and all the stocks in them. I would like to have the values > 100 to be green, and &lt; 100 to be red. Here's my code:</p>
  
  <pre><code>sector_lst = ['XLK','XLF','XLE']  ## etc.
  
  for i in sector_lst:                   
      fig = plt.figure(figsize=(12, 8)) 
  
      for x in sectordict[i]:                #sectordict[i] is all the stocks in a sector (so AAPL, GOOG, etc. for tech) 
          if pct_change[x] &gt; 1:              
               pct_change[sectordict[i]].plot(kind='bar',color='g') 
  
          ##if pct_chg &lt; 1
          else:                              
               pct_change[sectordict[i]].plot(kind='bar',color='r') 
  
  
  plt.title(i)
  </code></pre>
  
  <p>So far this is returning the whole sector graphs as green or red; if the first value is > 100 all stocks will be green and vice versa. </p>
  
  <p>My expected output is to have 11 graphs (which it currently does), but with different colors for each stock within the graph, if stock had > 100% return then it shows green and &lt; 100% it shows red.</p>