title: Filling bars with a color gradient in barplot ggplot2 R
body: <p>I want to fill bars with collors accotrding to a color scale.
  The problem is that I can achieve that ggplot2 fill all bars with desired tones.
   I am doing:</p>
  
  <pre><code>p &lt;- ggplot(data=base_c2, aes(x=c2_inicio, y=incid_usuar)) +
    geom_bar(stat="identity", width=0.8, fill=base_c2$incid_usuar) +
   scale_color_gradient2(midpoint=mean(base_c2$incid_usuar), 
                          low ="#91CF60",mid = "#FFFFBF", high = "#FC8D59",
                           space ="Lab")
  p
  </code></pre>
  
  <p>but the result is:<a href="https://i.stack.imgur.com/SbVaf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SbVaf.png" alt="enter image description here"></a></p>
  
  <p>how can achieve a smoooth grtadient?
   (green in low values, yellow in values close to the mean, red for high values)</p>