Next: rowplot() Up: Graphics Macros Help File Previous: plotmatrix()   Contents

plotpanes()

Usage:
plotpanes(x,y [,addlabels:T, labels:structure(labsx,labsy)]\
  [,names:vector(xname,yname)] [,hstrips:h, vstrips:v]\
  [,graphics keyword phrases]), x and y REAL vectors or matrices,
  labsx, labsy CHARACTER scalars or vectors, xname,yname CHARACTER
  scalars, h > 0, v > 0 integers.



Keywords: panel graphs, line graphs
plotpanes(x, y) draws a panel graph (see topic 'panel_graphs') whose
panes contain reduced size plots of each column of REAL vector or
matrix y against the corresponding column of REAL vector or matrix x.
If neither x and y are vectors, ncols(x) = ncols(y) is required.  If
one, say x, is a vector and the other (y) is a matrix, the each column
of y is plotted against x.

The plots are arranged in a h by v array of panes where either h = v or
h = v - 1.

Each pane is drawn using macro panelplot().

plotpanes(x,y) differs from plotmatrix(x,y) in that the plotpanes()
plots column j of y only against column j of x, and not all against all
columns of x.

You can use most of the standard standard graphics keywords except
'add', 'logx', 'logy' and any keywords having to do with tick marks.
In particular, you can use 'symbols', 'window', 'show', 'title',
'xlab', 'ylab', 'xmin', 'xmax', 'ymin', 'ymax', 'xaxis', 'yaxis',
'lines', 'linetype', 'impulses' and keywords having to do with files.
See topic 'graph_keys'.

The default value of 'symbols' is "\007" = "\x07" (dot), except with
lines:T, when no symbols are drawn.  Small characters, code 9 ("\011"
or "\x09") through 24 ("\030" or "\x18") are recommended.

There are no labelled ticks on the small graphs.  If either or both of
the x-axis or y-axis are within the limits of the data, they are drawn
unless suppressed by xaxis:F or yaxis:F.

If nrows(x) <= 2 and differs from nrows(y), each plot has equally
spaced x-values starting with x[1,] and incrementing by x[2,] (by 1 if
nrows(x) = 1), just as happens with standard plotting commands such as
plot(), lineplot() and chplot().

plotpanes(x,y,hstrips:h, vstrips:v), h > 0, v > 0 integers, does the
same except the array of plots is h by v.  h and v must satisfy h*v >=
max(ncols(x),ncols(y)).  If just one of 'hstrips' and 'vstrips' is
provded, the value for the other is selected large enough to hold all
plots.  'hstrips' and 'vstrips' can be used with any other keywords.

plotpanes(x, y, names:vector(xname,yname)), where xname and yname are
CHARACTER scalars, does the same, with xname and yname used to generate
the graph title and labels for the x and y axes. 'names' can be used
with any other keywords.  If you use keywords 'title', 'xlab' or
'ylab', their values take precedence over labels generated from xname
and yname.

plotpanes(x, y, labels:structure(labsx, labsy)), where labsx and labsy
are CHARACTER scalars or vectors, enables interactive addition of
labels to each plot.  If labsx or labsy is a vector, it must have
length max(ncols(x), ncols(y)).  If either is a scalar, it is expanded
to a vector by appending "1", "2", ....  The labels generated for
positioning using Mouse() are of the form paste(labsy[i],"vs",labsx[i]).
Thus, labs(structure("X","Y")) generates labels "Y1 vs X1", "Y2 vs X2",
... .

plotpanes(x,y,addlabels:T) is another way to specify labels.  Column
labels of x and/or y, if they exist, are used for labsx and labsy.
When column labels do not exist, labsx and/or labsy are assumed to be
"X" and "Y", repectively.  With 'addlabels:F', the value of 'labels',
if any, is ignored.

With 'show:F' the values of 'labels' and 'addlabels', if any, are
ignored.

The values of any of 'xmin', 'xmax', 'ymin' or 'ymax' can either be
scalars to be used in every small graph, or vectors with length
matching ncols(x) or ncols(y).  As usual, MISSING means the extreme is
to be determined from the data

Example:
  Cmd> irisdata <- matread("macanova.dat","irisdata") #Fisher data

  Cmd> # col 1 is variety number, 2 - 5 are data

  Cmd> colnames <- vector("SepLen","SepWid","PetLen","PetWid")

  Cmd> plotpanes(1,irisdata[,-1], names:vector("Index","Iris data"),\
       labels:structure("Index",colnames),\
       symbols:vector("\21","\22","\23")[irisdata[,1]])

This creates a 2 by 2 panel plot containing plots of all variables
against the observation number.

See also topics plotmatrix(), panelplot(), panelhist(), 'graphs',
'graph_keys', plot(), lineplot(), chplot().


Gary Oehlert 2003-01-15