powered by
draw border for each of the ggplot legends
keybox(p, grob = "roundrect", gp = NULL)
grob object
a ggplot object
one of 'rect' or 'roundrect'
graphic parameter
Guangchuang Yu
library(ggplot2) p <- ggplot(mtcars, aes(mpg, disp, color=factor(cyl), size=cyl)) + geom_point() keybox(p, 'roundrect', gp = gpar(col = '#808080', lty = "dashed"))
Run the code above in your browser using DataLab