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

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -