splitplot: Partitions plot space into rectangular grid

Description Usage Arguments Value Note See Also Examples

Description

Uses the plt argument of the par function to divide the space according to the input grid.

Usage

1
splitplot(nrows, ncols, i=1, new=as.logical(i > 1 && i <= nrows*ncols), gap=0.15)

Arguments

nrows

an integer defining the number of desired rows in the plot grid.

ncols

an integer defining the number of desired column in the plot grid.

gap

a numeric scalar used a nudge factor for the gap between plots in both the x- and y-directions. Default: 0.15.

i

selects the ith plot of the current nrow by ncol plot grid for the next plot. The upper left plot region is denoted by i=1 and increments moving from left to right, then top to bottom. Default: 1.

new

a logical flag. If TRUE, a new plot grid is established and previously defined plot regions are erases. Default: as.logical(i > 1).

Value

the original plt value of the par function prior to the call. The user can use this to reset plt to its original values.

Note

The plt option of the par function is altered.

See Also

stackPlot.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## establish a 2x2 plot grid and select the first 
## for plotting 
old.plt <- splitplot(2,2,1)

## plot the data 
for (i in seq(4)){
    if (i > 1)
       splitplot(2,2,i)

    plot(rnorm(100)*i)
    mtext(paste("i=", i, sep=""), side=3, line=0.5)
}

## return the original plot state of plt in par 
par(old.plt)

ifultools documentation built on May 2, 2019, 4:48 p.m.