Description Usage Arguments Value Examples
Draw user-defined grobs, typically annotations, at specific locations.
1 |
mapping |
mapping |
data |
data |
inherit.aes |
inherit.aes |
... |
arguments passed to the geom's draw_group method |
layer
1 2 3 4 5 6 7 8 9 10 11 12 | library(grid)
d <- data.frame(x=rep(1:3, 4), f=rep(letters[1:4], each=3))
gl <- replicate(4, matrix(sample(palette(), 9, TRUE), 3, 3), FALSE)
dummy <- data.frame(f=letters[1:4], data = I(gl))
ggplot(d, aes(f,x)) +
facet_wrap(~f)+
theme_bw() +
geom_point()+
geom_custom(data = dummy, aes(data = data, y = 2),
grob_fun = function(x) rasterGrob(x, interpolate = FALSE,
width=unit(1,'cm'),
height=unit(1,'cm')))
|
Loading required package: gridExtra
Loading required package: ggplot2
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.