Is it possible to specify thresholds for color-scales?
Look at this example:
xy <- expand.grid(x=1:20,y=1:20)
xyd <- data.frame(xy,z=runif(400),a=rowSums(xy)/40)
g <- 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
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.