title: What is the logic for scale_color_gradient in r?
body: <p>Here is an EASY question, but I can't find any information on it.  I know how <code>scale_color_gradient</code> would work in one dimension, but I can't figure out how it works in two dimensions.  In one dimension the values get coloured based on whether they are closer to the low colour or the high colour, or some portion in-between.</p>
  
  <p>But how does this work in two dimensions?  Do both values have to be high to be coloured that way, or just one?</p>
  
  <p>For example - consider</p>
  
  <pre><code>ggplot(mtcars, aes(x=wt, y=mpg, color=qsec)) + 
    geom_point()+
    scale_color_gradient(low="blue", high="red")
  </code></pre>
  
  <p>I can't figure out the logic on how these dots are coloured.  Middle dots seem to be high coloured, and extreme points seem to be low coloured.  What gives?</p>