ggplot_build
ggplot_build() takes the plot object, and performs all steps necessary to produce an object that can be rendered.
- plot data
- panel object
p <- ggplot() + geom_density(data = mtcars, aes(x = mpg, fill = "color1")) +
geom_density(data = mpg, aes(x = hwy, fill = "color2"))
ggplot_build(p)
Point size
guides(colour = guide_legend(override.aes = list(size=5)))
guides(alpha = guide_legend(override.aes = list(size=5, fill = 'black')))