我正在尝试将两个情节patchwork
objects
放在一起。代码有效但plot_annotations
消失了。
如何解决这个问题?
数据+代码:
library(tidyverse)
library(patchwork)
#Plot 1
GG1 = ggplot(iris,aes(x=Sepal.Length,y=Sepal.Width))+
geom_point()
#Plot 2
GG2 = ggplot(iris,aes(y=Sepal.Length,x=Sepal.Width))+
geom_point()
#Plot 3
GG3 = ggplot(iris,aes(y=Petal.Width,x=Sepal.Width))+
geom_point()
#Plot 4
GG4 = ggplot(iris,aes(y=Petal.Length,x=Petal.Width))+
geom_point()
combine_1 = GG1 + GG2 +
plot_annotation(title = 'Combine plot 1',
theme = theme(plot.title = element_text(hjust = 0.5)))
combine_2 = GG3 + GG4 +
plot_annotation(title = 'Combine plot 2',
theme = theme(plot.title = element_text(hjust = 0.5)))
combine_1/combine_2
输出