ggmultiplot | R Documentation |
Uses functions in grid to arrange one or more
ggplot
objects into a single layout.
ggmultiplot(..., plotlist = NULL, ncol = 1L, layout = NULL)
... |
ggplot objects |
plotlist |
list of ggplot objects (optional) |
ncol |
number of columns in layout |
layout |
matrix specifying the layout; if present, if layout is |
library('ggplot2')
gg <- ggplot(mtcars, aes(factor(1), fill = factor(cyl))) +
geom_bar(width = 1) + theme_minimal()
gg1 <- gg + coord_polar()
gg2 <- gg + coord_polar(theta = 'y')
gg3 <- ggplot(mtcars, aes(factor(cyl), fill = factor(cyl))) +
geom_bar(width = 1) + coord_polar() + theme_minimal()
ggmultiplot(gg)
ggmultiplot(gg1, gg2, gg3, ncol = 2)
ggmultiplot(
gg1, gg2, gg3,
layout = matrix(c(1, 2, 3, 3, 3, 3), ncol = 2, byrow = TRUE)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.