# NOT RUN {
library(ggplot2)
library(metan)
p1 <- ggplot(mtcars, aes(wt, mpg)) +
geom_point()
p2 <- ggplot(mpg, aes(class, hwy)) +
geom_boxplot()
# Default plot
arrange_ggplot(p1, p2)
# Insert plot annotation, titles and subtitles
arrange_ggplot(p1, p2,
ncol = 1,
tag_levels = list(c("(P1)", "(P2)")),
title = "My grouped ggplot",
subtitle = "Made with arrange_ggplot()",
caption = "P1 = scatter plot\nP2 = boxplot",
theme = theme(plot.title = element_text(size = 20,
face = "bold"),
plot.subtitle = element_text(size = 10,
face = "italic"),
plot.caption = element_text(size = 10,
face = "italic")))
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab