Learn R Programming

ifultools (version 2.0-26)

splitplot: Partitions plot space into rectangular grid

Description

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

Usage

splitplot(nrows, ncols, i=1, new=as.logical(i > 1 && i 

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.

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).

See Also

stackPlot.

Examples

Run this code
## 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)

Run the code above in your browser using DataLab