multiplot: Put Multiple Plots on a Page

View source: R/multiplot_function.R

multiplotR Documentation

Put Multiple Plots on a Page

Description

This function places a list of ggplot objects into a single object. taken from RBloggers, 3july12, combining ggplot images, https://www.r-bloggers.com/2012/07/combining-ggplot-images/

Usage

multiplot(..., plotlist = NULL, cols)

Arguments

plotlist

A list of plots to be combined. Defaults to NULL.

cols

Number of columns of plots.

Examples


x <- rnorm(100, 10, 3)
y <- rnorm(200, 10, 3)
test.dat <- as.data.frame(cbind(x, y))
fig.1 <- ggplot2::ggplot(test.dat, aes(x,y)) + geom_point()
fig.2 <- ggplot2::ggplot(test.dat[which(test.dat$x > 5),], aes(x,y)) + geom_point()
multiplot(fig.1, fig.1, cols=2)

JenC36/JACtools documentation built on Oct. 20, 2024, 8:05 a.m.