r - Why doesn't annotation_raster work? -
in documentation, there's 1 example showing usage of annotation_raster
below.
ggplot(aes(x=mpg, y=wt), data=mtcars) + annotation_raster('red', -inf, inf, -inf, inf) + geom_point()
this works fine, however, when move data , aes layer, doesn't work anymore:
ggplot() + annotation_raster('red', -inf, inf, -inf, inf) + geom_point(aes(x=mpg, y=wt), data=mtcars) # doesn't work
this perplexing because me these 2 seem semantically identical.
is there reason why second line won't work , there way use annotation_raster
without specifying data , aes in base layer?
Comments
Post a Comment