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 = NULL, y = NULL, indx = NULL, indy = NULL, type = "p",
frame = FALSE, title = FALSE,
plargs = NULL, ploptions = NULL, marpar = NULL, ...)panelSmooth(x, y, indx, indy, plargs = NULL, ...)
plpanelCond(x, y, ckeyx, ckeyy, pch = 1, pcol = 1, psize = 1,
pale = c(0.2, 0.6), csize = 0.8,
smooth = NULL, smooth.minobs = NULL, plargs = NULL, ploptions = NULL, ...)
none
values of the horizontal variable
values of the vertical variable
index of the variable shown horizontally, among the
y
variables
index of the variable shown horizontally, among the
y
variables
type of plot as usual in R: "p" for points, ...
logical: should plframe
be called?
logical: should pltitle
be called?
vectors of 'keys' to calculate paling values and
weights for smoothing. NA means that points should not be shown
in this panel. 0 means no paling and weight 1.
Other values are between -1 and 1,
cpl=(1-abs(ckeyx))*(1-abs(ckeyy))
is used for paling and weights.
vector of plotting symbols, colors and sizes for plotting points
vector of length 2 indicating the range of paling values
obtained from cpl
values from 1 to 0.
factor applied to the character expansion of the points
with cpl<1
should a smooth line be drawn?
minimum number of points required for calculating and showing a smooth line
result of calling pl.control
.
If plargs
is NULL
, pl.control
will be called to
generate it.
The components are often needed to generate the panel.
margin parameters, if already available.
By default, they will be retieved from ploptions
.
further arguments passed to
plpoints, plmboxes, plsmooth
Werner A. Stahel, ETH Zurich
The panel function plpanel
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 modify pl.envir
,
in contrast to plyx
.
plpanelCond
shows selected points only and may show
some of them with reduced size and paled color.
It is appropriate for the high level function plcond
.
plyx
is essentially a wrapper function of
plpanel
which calls pl.control
and provides additional
features.
plmatrix
also uses plpanel
, whereas
plcond
uses plpanelCond
.
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)
Run the code above in your browser using DataLab