plpanel: Panel function for multiple plots

plpanelR Documentation

Panel function for multiple plots

Description

Draw a scatterplot or multibox plot, usuallly after pl.control and plframe have been called. May also be used to augment an existing plot.

Usage

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

Arguments

x

values of the horizontal variable

y

values of the vertical variable

indx

index of the variable shown horizontally, among the y variables

indy

index of the variable shown horizontally, among the y variables

type

type of plot as usual in R: "p" for points, ...

frame

logical: should plframe be called?

title

logical: should pltitle be called?

ckeyx, ckeyy

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.

pch, pcol, psize

vector of plotting symbols, colors and sizes for plotting points

pale

vector of length 2 indicating the range of paling values obtained from cpl values from 1 to 0.

csize

factor applied to the character expansion of the points with cpl<1

smooth

should a smooth line be drawn?

smooth.minobs

minimum number of points required for calculating and showing a smooth line

plargs, ploptions

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.

marpar

margin parameters, if already available. By default, they will be retieved from ploptions.

...

further arguments passed to plpoints, plmboxes, plsmooth

Details

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.

Value

none

Note

These functions are rarely called by the user. The intention is to modify ond of them and then call the modified version when using plyx, plmatrix or plcond by setting panel=mypanel.

Author(s)

Werner A. Stahel, ETH Zurich

See Also

plyx is essentially a wrapper function of plpanel which calls pl.control and provides additional features. plmatrix also uses plpanel, whereas plcond uses plpanelCond.

Examples

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)

plgraphics documentation built on Oct. 19, 2023, 3 p.m.