Suppose we create a colored band in R:
library(ggplot2)
dev.new(width=6, height=3)
ggplot(data.frame(20,20)) +
geom_rect(aes(xmin=0, xmax=100, ymin=0, ymax=50), fill="blue")
I would like to continuously vary the transparency of the band along the y-axis with the alpha value normally distributed:
dnorm(y - 25) / 12.5) / dnorm(0)
How to achieve this? Thanks!