Combining and arranging multiple plots in a grid
Wrapper around patchwork::wrap_plots that will return a combined grid of
plots with annotations.
combine_plots( plotlist, guides = "collect", plotgrid.args = list(), annotation.args = list(), ... )
plotlist |
A list containing |
guides |
A string specifying how guides should be treated in the layout.
|
plotgrid.args |
A |
annotation.args |
A |
... |
Currently ignored. |
Combined plot with annotation labels
# loading the necessary libraries
library(ggplot2)
# preparing the first plot
p1 <-
ggplot2::ggplot(
data = subset(iris, iris$Species == "setosa"),
aes(x = Sepal.Length, y = Sepal.Width)
) +
geom_point() +
labs(title = "setosa")
# preparing the second plot
p2 <-
ggplot2::ggplot(
data = subset(iris, iris$Species == "versicolor"),
aes(x = Sepal.Length, y = Sepal.Width)
) +
geom_point() +
labs(title = "versicolor")
# combining the plot with a title and a caption
combine_plots(
plotlist = list(p1, p2),
annotation.args = list(
tag_levels = "a",
title = "Dataset: Iris Flower dataset",
subtitle = "Edgar Anderson collected this data",
caption = "Note: Only two species of flower are displayed"
)
)Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.