plpanel {plgraphics}R 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, y, indx = NULL, indy = NULL, type = "p", frame = FALSE,
  title = FALSE, plargs = NULL, ploptions = NULL, ...)

panelSmooth(x, y, indx, indy, 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?

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.

...

further arguments passed to plmboxes

Details

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.

Value

none

Note

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.

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.

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)

[Package plgraphics version 1.0 Index]