Learn R Programming

see (version 0.4.1)

plots: Multiple plots side by side

Description

A wrapper around gridExtra::grid.arrange to plot multiple figures side by side on the same page.

Usage

plots(..., n_rows = NULL, n_columns = NULL, tags = FALSE)

Arguments

...

grobs, gtables, ggplot or trellis objects

n_rows

Number of rows to align plots.

n_columns

Number of columns to align plots.

tags

Add tags to your subfigures. Can be FALSE (no tags), TRUE (letter tags) or character vector containing tags labels.

Examples

Run this code
# NOT RUN {
library(ggplot2)
library(see)

p1 <- ggplot(iris, aes(x = Petal.Length, y = Sepal.Width)) + geom_point()
p2 <- ggplot(iris, aes(x = Petal.Length)) + geom_density()

plots(p1, p2)
plots(p1, p2, n_columns = 2, tags = TRUE)
plots(p1, p2, n_columns = 2, tags = c("Fig. 1", "Fig. 2"))
# }

Run the code above in your browser using DataLab