plpanel {plgraphics} | R Documentation |
Draw a scatterplot or multibox plot, usuallly after pl.control
and plframe
have been called.
May also be used to augment an existing plot.
plpanel(x, y, indx = NULL, indy = NULL, type = "p", frame = FALSE, title = FALSE, plargs = NULL, ploptions = NULL, ...) panelSmooth(x, y, indx, indy, plargs = NULL, ploptions = NULL, ...)
x |
values of the horizontal variable |
y |
values of the vertical variable |
indx |
index of the variable shown horizontally, among the
|
indy |
index of the variable shown horizontally, among the
|
type |
type of plot as usual in R: "p" for points, ... |
frame |
logical: should |
title |
logical: should |
plargs, ploptions |
result of calling |
... |
further arguments passed to |
The panel function draws a scatterplot if both x
and y
are
numerical, and a multibox plot if one of them is a factor and
ploptions$factor.show == "mbox"
.
Grouping, reference and smooth lines and properties of the points
are determined by the component of plargs
in plpanel
.
This function is usually called by the high level pl functions
plyx
and plmatrix
.
A different suitable function can be used by setting their
argument panel
.
The first arguments, x
and y
,
can be formulas, and an argument data
can be given.
These arguments then have the same meaning as in plyx
,
with the restriction that only one variable should result for
the x
and y
coordinates in the plot.
When frame
is true, plpanel
can be used instead of
plyx
for generating a single plot.
Note that plpanel
does not set .plargs
in the
global environment, in contrast to plyx
.
none
This function is rarely called by the user.
The intention is to modify it and then call the modified version
when using plyx
or plmatrix
by setting
panel=mypanel
.
Werner A. Stahel, ETH Zurich
plyx
is essentially a wrapper function of
plpanel
which calls pl.control
and provides additional
features.
t.plargs <- pl.control(~Species+Petal.Length, ~Sepal.Width+Sepal.Length, data=iris, smooth.group=Species, pcol=Species) t.plargs$ploptions$group.col <- c("magenta","orange","cyan") plpanel(iris$Petal.Length, iris$Petal.Width, plargs=t.plargs, frame=TRUE)