Plot title with patchwork

Hi,
I just cite the Exapmle code in the manual of package"patchwork"(p7, plot annotation) and make adjustment. I am not sure it is what you want to achieve. Maybe you could ask question by providing a relevant REPRoducible EXample (reprex) . And then, maybe other people colud help you more. I am R beginner now.

library(patchwork)
library(ggplot2)
p1 <- ggplot(mtcars) + geom_point(aes(mpg, disp))
p2 <- ggplot(mtcars) + geom_boxplot(aes(gear, disp, group = gear))
p3 <- ggplot(mtcars) + geom_bar(aes(gear)) + facet_wrap(~cyl)
# Add title, etc. to a patchwork
p1 + p2 + plot_annotation('This is a title', caption = 'made with patchwork',theme=theme(plot.title=element_text(hjust=0.5)))

Created on 2022-11-21 with reprex v2.0.2

1 Like