p1 <- ggplot(mtcars) +
geom_point(aes(mpg, disp))
p2 <- ggplot(mtcars) +
geom_boxplot(aes(gear, disp, group = gear))
p3 <- ggplot(mtcars) +
geom_bar(aes(gear)) +
facet_wrap(~cyl)
align_plots(
p1 + theme(plot.background = element_blank()),
p2 + theme(plot.background = element_blank()),
p3 + theme(plot.background = element_blank())
) +
layout_annotation(
theme = theme(plot.background = element_rect(fill = "red"))
)
Run the code above in your browser using DataLab