title: ggplot2: barplot with colors as a function of y-axis value
body: <p>I have this simple code (data + barplot) :</p>
  
  <pre><code>dat &lt;- c('Jan','Feb','Mar', 'Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec')
  val &lt;- c(-2.5, 3, 2.5, -3.3, -1, 0.2, 6, 4.3, 5.5, 2, -1.9, -2.3)
  df &lt;- data.frame(dat, val)
  bar &lt;- ggplot(data = df, aes(x = factor(dat, levels = month.abb), y = val)) +
      geom_bar(stat = 'identity')
  print(bar)
  </code></pre>
  
  <p>Elsewhere I created a heatmap using the following palette:</p>
  
  <pre><code># Palette
  LtoM &lt;-colorRampPalette(c('red', 'yellow' ))
  Mid &lt;- "snow3"
  MtoH &lt;-colorRampPalette(c('lightgreen', 'darkgreen'))
  </code></pre>
  
  <p>that is called by:</p>
  
  <pre><code>scale_fill_gradient2(low = LtoM(100), mid = Mid, high = MtoH(100))
  </code></pre>
  
  <p>Now I would like to use a similar color palette for my barplot, that is I would like the color in each bar to be a function of the height (some grade from red for mimimum y to green for maximum y).</p>
  
  <p>How can I do that, please?</p>