multiplot: Multiple plot function

Description Usage Arguments Details Examples

Description

To arrange multiple ggplot chart on a grid. Copied from: http://www.cookbook-r.com/Graphs/Multiple_graphs_on_one_page_(ggplot2)/

Usage

1
multiplot(plotlist = NULL, cols = 1, layout = NULL)

Arguments

plotlist

a list of ggplot objects

cols

Number of columns in layout

layout

A matrix specifying the layout. If present, 'cols' is ignored.

Details

Arrange different ggplot objects on the same page

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 ll go all the way across the bottom.

Examples

1
2
3
4
5
require(ggplot2)
require(swiTheme)
q1 <- qplot(1:10, 1:10, size = 10:1) + xlab("axis x label") + ylab ("y axis label")
q2 <- qplot(mpg, data = mtcars, geom = "dotplot")
multiplot(list(q1, q2))

d-qn/swiTheme documentation built on May 14, 2019, 3:04 p.m.