Description Usage Arguments Details Author(s)
Lay out multiple ggplots on one frame or page.
1 |
... |
Where the ggplot objects are placed to be laid out on the graph grid |
plotlist |
Can be used in place of the ... argument by specifying the ggplot objects as a list object |
file |
Not sure what this is used for |
cols |
Number of columns for the layout. For example cols=2 provides two columns and with four ggplot objects, the resulting output would be a 2 by 2 graphic |
layout |
A matrix that indicates the plot grid layout. For example, if layout = matrix(c(1, 2, 3, 3), nrow = 2, byrow = TRUE) the result would have plot 1 in the upper left, plot 2 in the upper right, and plot 3 would be go across the bottom |
This function, which was from http://www.cookbook-r.com/Graphs, is used to lay out several ggplot objects onto one frame or pdf page. For instance, you can have 3 plots on a page, one going vertically across the top, the other two in each corner on the bottom. This function makes up for the difficulty ggplot2 has with outputting multiple plots on one grid. This function depends on grid.
Cookbook R
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.