Description Usage Arguments Details Examples
Takes a list of ggplot objects and prints these using a
grid layout supplied by grid.layout.
In this way, a list of plots can be laid out in complex
ways on the screen.
1 2 3 | gglayout(plotList,
layout = grid.layout(1, length(plotList)),
colwise = TRUE, rowwise = !colwise)
|
plotList |
A |
layout |
A layout provided by
|
The plotsin plotList are printed sequentially to
the viewports defined by layout, in order of rows
followed by columns. If an element of plotList is
NULL, then that plot is empty.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | require(ggplot2)
require(grid)
p <- ggplot(mtcars, aes(factor(cyl)))
pList <- list(
p + geom_bar(),
NULL,
p + geom_bar() + coord_flip(),
p + geom_bar(fill="white", colour="darkgreen")
)
gglayout(pList)
gglayout(pList, layout=grid.layout(4, 1))
gglayout(pList, layout=grid.layout(1, 4))
gglayout(pList, layout=grid.layout(2, 2), rowwise=TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.