View source: R/multiplot_function.R
multiplot | R Documentation |
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/
multiplot(..., plotlist = NULL, cols)
plotlist |
A list of plots to be combined. Defaults to NULL. |
cols |
Number of columns of plots. |
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.