真是赏心悦目极大提高生活质量的包啊。
先来个reprex
library(patchwork)
library(ggplot2)
library(dplyr)
p = diamonds %>%
ggplot(aes(carat, price,color=clarity))+geom_point()
p2 = diamonds %>%
ggplot(aes(depth,table,color= price))+ geom_hex()
p3 = diamonds %>%
ggplot(aes(clarity, price, fill=cut))+geom_boxplot(position="dodge")
# patchwork
p |p2 /p3
# cowplot
col2=cowplot::plot_grid(p2,p3,ncol=1)
cowplot::plot_grid(p,col2)
<sup>Created on 2020-02-17 by the reprex package (v0.3.0)</sup>