How to use patchwork package(Visualization) in R
library(ggplot2) library(patchwork) p1 <- ggplot(mtcars) + geom_point(aes(mpg, disp)) + ggtitle('Plot 1') p1 p2 <- ggplot(mtcars) + geom_boxplot(aes(gear, disp, group = gear)) + ggtitle('Plot 2') p2 p3 <- ggplot(mtcars) + geom_point(aes(hp, wt, colour = mpg)) + ggtitle('Plot 3') p3 p4 <- ggplot(mtcars) + geom_bar(aes(gear)) + facet_wrap(~cyl) + ggtitle('Plot 4') p4 p1 + p2 p1 + p2 + labs(subtitle = 'This will appear in the last plot') p1 + p2 + p3 + p4 p1 + p2 + p3 + p4 + plot_layout(nrow = 3, byrow = FALSE) p1 / p2 (p1 / p2) | p3 (p1 | (p2 / p3)) + plot_annotation(title = 'The surprising story about mtcars') p1 + p2 + p3 + plot_annotation(tag_levels = 'I') library(devtools) library(ggplot2) library(patchwork) d1 <- runif(500) d2 <- rep(c("Treatment","Control"),each=250) d3 <- rbeta(500,shape1=100,shape2=3) d4 <- d3 ...