Reputation: 496
I aranged a set of R plots into one using ggarange, How can I label them A,B and C at the top left of each subplot?
Code:
library(ggplot2)
library(ggpubr)
# default ggplot2 theme
P1 <- ggplot(iris, aes(Sepal.Length, Petal.Width, color = Species)) +
geom_point()
P2 <- ggplot(iris, aes(Sepal.Length, Sepal.Width, color = Species)) +
geom_point()
P3 <- ggplot(iris, aes(Petal.Length, Sepal.Width, color = Species)) +
geom_point()
ggarrange(P1, P2, P3, ncol=3, nrow=1, common.legend = TRUE, legend="bottom")
Upvotes: 1
Views: 719
Reputation: 56159
Use labels:
ggarrange(P1, P2, P3, labels = c("A", "B", "C"),
ncol = 3, nrow = 1,
common.legend = TRUE, legend = "bottom")
Upvotes: 2