library(ggplot2)
library(patchwork)
p <- ggplot(
data = mtcars,
aes(x = mpg, y = wt, colour = cyl)
) +
geom_point() +
scale_x_continuous(limits = c(10, 30)) +
scale_y_continuous(limits = c(1, 6))
object.size(p)
p_drop <- drop_data(p)
object.size(p_drop)
p / p_drop
Run the code above in your browser using DataLab