library(cowplot)
library(ggplot2)
library(cowplot)
#install.packages("magick")
library(magick)
devtools::install_github("GuangchuangYu/ggimage")
devtools::install_github("GuangchuangYu/ggplotify")
devtools::install_github("GuangchuangYu/yyplot")
###画图
p1<-ggplot(iris, aes(x = Sepal.Length, fill = Species)) + geom_density(alpha = 0.7)
p2 <- ggplot(iris, aes(x = Sepal.Length, fill = Species)) + geom_density(alpha = 0.7)
p3<-ggplot(iris, aes(x = Sepal.Length, fill = Species)) + geom_density(alpha = 0.7)
拼图
plot_grid(p, p1,p3,labels = "AUTO")
也可以根据需要进行调整
plot_grid(
plot_grid(p1, p3$gtable, ncol=2, rel_widths=c(.6, 1), labels=LETTERS[1:2]),
p3, ncol=1, labels=c("", "C"))
plot_grid(p1,p1,p1,p1,
labels = c('A','B','C','D'),
ncol = 1, nrow = 4)
网友评论