plmatrix {plgraphics}R Documentation

Scatterplot Matrix

Description

Plots a scatterplot matrix, for which the variables shown horizontally do not necessarily coincide with those shown vertically. If desired, the matrix is divided into several blocks such that it fills more than 1 plot page.

Usage

plmatrix(x, y = NULL, data = NULL, panel = plpanel, panelargs = plargs, 
         nrow = 0, ncol = nrow, reduce = TRUE, keeppar = FALSE,
         xaxmar=NULL, yaxmar=NULL, xlabmar=NULL, ylabmar=NULL,
         xlab=NULL, ylab=NULL,
         oma=NULL, cex = NULL, diaglabel.cex = NULL,
         plargs = NULL, ploptions = NULL, ...) 

Arguments

x

data for columns (x axis), or formula defining column variables. If it is a formula containing a left hand side, the left side variables will be used last.

y

data or formula for rows (y axis). Defaults to x

data

data.frame containing the variables in case x or y is a formula

panel

a function that generates the marks of the individual panels, see Details. Defaults to plpanel, which results essentially in points or text depending on the argument pch, to plmboxes if 'x' is a factor and 'y' is not or vice versa, or to a modification of sunflowers if both are factors.
The function must have the arguments x and y to take the coordinates of the points and may have the arguments indx and indy to transfer the variables\' index and panelargs for any additional objects to be passed on.

panelargs

a list of arguments to be passed to the panel function, in addition to x, y, indx, indy

nrow

number of rows of panels on a page

ncol

number of columns of panels on a page

reduce

if y is not provided and reduce==TRUE, the first row and the last column are suppressed.

keeppar

logical. If TRUE, the graphical settings "mfrow", "mar", "cex", and "mgp" will be maintained, otherwise, the old values will be restored (default).

xaxmar, yaxmar

margin in which the axis (tick marks and corresponding labels) should be shown: either 1 or 3 for xaxmar and 2 or 4 for yaxmar.

xlabmar, ylabmar

in which margin should the x- [y-] axis be labelled?

xlab, ylab

not used (introduced to avoid confusion with xlabmar, ylabmar)

oma

width of outer margins, ee par

cex

general character expansion, will be multiplied by par("cex")

diaglabel.cex

Character expansion for labels appearing in the "diagonal" of the scatterplot matrix (if present)

plargs

result of calling pl.control. If NULL, pl.control will be called to generate it. If not null, arguments given in ... will be ignored.

ploptions

list of pl options.

...

further arguments passed to the panel function and possibly further to functions called by the panel function

Details

The panel function can be user written. It needs >=5 arguments which must correspond to the arguments of plpanel: x, y, indx, indy, plargs. If some arguments are not used, just introduce them as arguments to the function anyway in order to avoid (unnecessary) error messages and stops.
Since large scatterplot matrices lead to tiny panels, plmatrix splits the matrix into blocks of at most nrow rows and ncol columns. If these numbers are missing, they default to nrow=5 and ncol=6 for landscape pages, and to nrow=8 and ncol=5 for portrait pages.

Value

none

Note

There are many more arguments, obtained from pl.control, see ?pl.control. These can be passed to plmatrix by an argument plargs that is hidden in the ... argument list.

Author(s)

Werner A. Stahel, ETH Zurich

See Also

pairs, plyx

Examples

plmatrix(iris, pch=as.numeric(Species))
plmatrix(~Sepal.Length+Sepal.Width, ~Petal.Length+Petal.Width,
    data=iris, smooth=TRUE, plab=substr(Species,1,2))

[Package plgraphics version 1.0 Index]