geom_rect and NULL
- by csgillespie
I've been looking at the geom_rect example in section 5.10 of the
ggplot2 book and don't understand the purpose of the NULL's in the aes
function. For example, using the mpg data:
g = ggplot(data=mpg, aes(x=displ, y=hwy)) + geom_point()
#Produces a plot with a transparent filled region
g + geom_rect(aes(NULL, NULL), alpha=0.1,xmin=5, xmax=7,…