multiplot: Plot multiple ggplots objects in one panel

MultiplotR Documentation

Plot multiple ggplots objects in one panel

Description

ggplot objects can be passed in ..., or to plotlist (as a list of ggplot objects)
For example, if the layout is specified as the 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.

Usage

Multiplot(..., Plotlist=NULL, ColNo=1, LayoutMat)

Arguments

...

multiple ggplot objects to be plotted

Plotlist

Optional: list filled with ggplot objects to be plotted

ColNo

Number of columns in layout

LayoutMat

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

Value

List with Plotlist

Author(s)

Winston Chang

Examples

data(Lsun3D)
Data=Lsun3D$Data
Cls=Lsun3D$Cls
obj1=Classplot(Data[,1],Data[,2],Cls=Cls,Plotter="ggplot",Size=3,main="Top plot")
obj2=Classplot(Data[,2],Data[,3],Cls=Cls,Plotter="ggplot",Size=3,main="Middle plot")
obj3=Classplot(Data[,1],Data[,3],Cls=Cls,Plotter="ggplot",Size=3,main="Bottom plot")
V=Multiplot(obj1,obj2,obj3)

Mthrun/DataVisualizations documentation built on Jan. 16, 2024, 1:01 a.m.