title: ggplot2: Thresholds for scale_alpha()
body: <p>Is it possible to specify thresholds for color-scales?</p>
  <p>Look at this example:</p>
  <pre><code>xy &lt;- expand.grid(x=1:20,y=1:20)
  xyd &lt;- data.frame(xy,z=runif(400),a=rowSums(xy)/40)
  g &lt;- ggplot(xyd, aes(x=x, y=y, fill=z, alpha=a)) + 
         geom_tile() + 
         scale_alpha(range=c(0,1), limits=c(0.5,1))
  g
  </code></pre>
  <p><img src="https://i.stack.imgur.com/MhlH7.png" alt="Scale_alpha only applies to values within the given limits" /></p>
  <p>What I want is that Values of a below 0.5 get an alpha value of 0 so that the lower left half will be invisible. Obviously I could transform the original data but that would destroy the legend.</p>