I wonder if there is a qay how to spread a plot tiltle across both ggplot_object_1 (g1 )and ggplot_object_2(g2) when I use patchwork as g1 + g2 so that the plot title would be in the centre of combined g1 and g2.
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)))