Suppose I want to merge the following six plots into one plot.
library(ggplot2)
p1 <- ggplot(mtcars) +
geom_point(aes(mpg, disp))
p2 <- ggplot(mtcars) +
geom_point(aes(mpg, disp))
p3 <- ggplot(mtcars) +
geom_point(aes(mpg, disp))
p4 <- ggplot(mtcars) +
geom_point(aes(mpg, disp))
p4 <- ggplot(mtcars) +
geom_point(aes(mpg, disp))
p5 <- ggplot(mtcars) +
geom_point(aes(mpg, disp))
p6 <- ggplot(mtcars) +
geom_point(aes(mpg, disp))
For this I use the package Pachwork:
library(patchwork)
(p1 | p2 | p2 ) / (p4 | p5 | p6 ) +
plot_annotation(title = "Perceptual Domain", tag_levels = 'A') &
theme(plot.title = element_text(hjust = 0.5), plot.tag = element_text(size = 15, face = "bold"))
I want to add a title for the upper three plots and a separate title for the lower three plots.
As you can see in the example I can only add one title but not a second one.
Can someone help me and show me how I can add a second title for the lower three plots?
