title: geom_rect and alpha - does this work with hard coded values?
body: <p>Same title, completely reworded the question though.</p>
  
  <p>Why does the alpha work in the first plot but not the second? I'm struggling to see why with hardcoded values the rect is drawn in the right place but not made transparent but when in a data.frame it works as expected?</p>
  
  <pre><code>mtcars$cyl &lt;- factor(mtcars$cyl)
  mtcars$am &lt;- factor(mtcars$am)
  
  ggplot(mtcars) +
      geom_density(aes(x=disp, group=cyl, fill=cyl), alpha=0.6, adjust=0.75) + 
      geom_rect(data=data.frame(xmin=100, xmax=200, ymin=0, ymax=Inf), aes(xmin=xmin, xmax=xmax, ymin=ymin,ymax=ymax), fill="red", alpha=0.2) 
  
  ggplot(mtcars) +
      geom_density(aes(x=disp, group=cyl, fill=cyl), alpha=0.6, adjust=0.75) + 
      geom_rect(aes(xmin=100, xmax=200, ymin=0,ymax=Inf), fill="red", alpha=0.2) 
  </code></pre>