multiplot: Multiple plot function

Description Usage Arguments Details Examples

Description

ggplot objects can be passed in ..., or to plotlist (as a list of ggplot objects) - cols: Number of columns in layout - layout: A matrix specifying the layout. If present, 'cols' is ignored.

Usage

1
2
multiplot(..., plotlist = NULL, cols = 1, layout = NULL,
  panelnames = NULL, panelnames.size = 16)

Arguments

...

plots to draw

plotlist

list of plots to draw

cols

number of columns

layout

matrix with layout specifications

panelnames

array of panel names (default LETTERS)

panelnames.size

size of panel names (default 16)

Details

If the layout is something like matrix(c(1,2,3,3), nrow=2, byrow=TRUE), then plot 1 will go in the upper left, 2 will go in the upper right, and 3 will go all the way across the bottom.

Examples

1
2
3
4
5
6
7
8
# getCombinedMaf(reports)
library(ggplot2)
p1 <- ggplot(mtcars, aes(factor(cyl), mpg)) + geom_boxplot()
p2 <- ggplot(mtcars, aes(x=mpg, fill=factor(cyl))) + geom_density(alpha=.7)
multiplot(p1, p2, cols = 2)
multiplot(p1, p2, cols = 2, panelnames = LETTERS)
multiplot(p1, p2, cols = 2, panelnames = LETTERS, panelnames.size = 24)
multiplot(p1, p2, p1, p2, layout=matrix(c(1,1,2,2,3,4), nc=3, byrow=FALSE), panelnames = LETTERS, panelnames.size = 24)

dakl/clinseqr documentation built on May 14, 2019, 3:30 p.m.