cowplot (version 0.3.1)

plot_grid: Arrange multiple plots into a grid

Description

Arrange multiple plots into a grid.

Usage

plot_grid(..., plotlist = NULL, nrow = NULL, ncol = NULL, scale = 1,
  labels = NULL, label_size = 14, cols = NULL, rows = NULL)

Arguments

...
List of plots to be arranged into the grid.
plotlist
(optional) List of plots to display. Alternatively, the plots can be provided individually as the first n arguments of the function plot_grid (see examples).
nrow
(optional) Number of rows in the plot grid.
ncol
(optional) Number of columns in the plot grid.
scale
(optional) Allows to set an overall scaling of each sub-plot. Can be set separately for each subplot, by giving a vector of scale values, or at once for all subplots, by giving a single value.
labels
(optional) List of labels to be added to the plots.
label_size
(optional) Numerical value indicating the label size. Default is 14. #'
cols
Deprecated. Like ncol.
rows
Deprecated. Like nrow.

Examples

Run this code
p1 <- qplot(1:10, 1:10)
p2 <- qplot(1:10, (1:10)^2)
p3 <- qplot(1:10, (1:10)^3)
p4 <- qplot(1:10, (1:10)^4)
plot_grid(p1, p2, p3, p4)
plot_grid(p1, p2, p3, p4, labels=c('A', 'B', 'C', 'D'))
plot_grid(p1, p2, p3, nrow=3, labels=c('A', 'B', 'C', 'D'), label_size=12)
plot_grid(p1, NULL, NULL, p2, p3, NULL, ncol=2,
 labels=c('A', 'B', 'C', 'D', 'E', 'F'), label_size=12)

Run the code above in your browser using DataCamp Workspace