Hi,
Is there a workaround to add plot tags (as in "A", "B", "C") when using patchwork, in which only some of the plots get a tag? IN my case, it is a 2X2 grid, and I want the labels " A" and "B" on the top left and top right plots
library(ggplot2)
library(patchwork)
p1 <- ggplot(mtcars) +
geom_point(aes(mpg, disp)) +
ggtitle('Plot 1')
p2 <- ggplot(mtcars) +
geom_boxplot(aes(gear, disp, group = gear)) +
ggtitle('Plot 2')
p3 <- ggplot(mtcars) +
geom_point(aes(hp, wt, colour = mpg)) +
ggtitle('Plot 3')
p4 <- ggplot(mtcars) +
geom_bar(aes(gear)) +
facet_wrap(~cyl) +
ggtitle('Plot 4')
# This tags all of the plots
(p1 | p2 ) /
(p3 | p4) +
plot_annotation(tag_levels = "A")
# This does not tag anyone
(p1 | p2 +
plot_annotation(tag_levels = "A")) /
(p3 | p4)
# This one gives you an error
(p1 | p2 )+
plot_annotation(tag_levels = "A") /
(p3 | p4)