plbars {plgraphics}R Documentation

Add bars to a pl plot

Description

Adds horizontal or vertical bars to a plot

Usage

plbars(x = NULL, y = NULL, midpointwidth = NULL, 
  plargs = NULL, ploptions = NULL, getpar = TRUE, ...)

Arguments

x, y

coordinates for the horizontal and veritical axis, respectively. Either of them must have 3 columns. If y has 3 columns, x must have one only or be a vector. Then y[,1] contains the midpoints, and the other two columns determine the endpoints of the bars, which will be vertical. Analogously if x has 3 columns.

midpointwidth

for plbars: determines the length of the segments that mark the midpoints. See Details.

plargs, ploptions

result of pl.control, see Details

getpar

logical: should graphical parameters cex, mar, mgp be set according to ploptions? See Details.

...

absorbs extra arguments

Details

For plbars, the argument midpointwidth determines the length of the segments that mark the midpoint relative to the default, which is proportional to the range of the plotting area and inversely proportional to the number of (finite) observations.

plargs and ploptions may be specified explicitly. Otherwise, they are taken from .plargs.

The argument getpar is used for setting the graphical parameters cex, mar, mgp according to ploptions. This is needed if the high level pl function has changed mar, since this change has been reversed when the function was left. By default, these graphical parameters will be retieved from .plargs$ploptions.

Value

None.

Author(s)

Werner A. Stahel

Examples

data(d.river)
dd <- plsubset(d.river, 1:2000)
da <- aggregate(dd[,3:7], dd[,"date",drop=FALSE], mean, na.rm=TRUE)
ds <- aggregate(dd[,3:7], dd[,"date",drop=FALSE], sd, na.rm=TRUE)
plyx(O2~date, data=da, type="n")
td <- da$O2 + outer(ds$O2, c(0,-1,1))
plbars(y = td, midpointwidth=0.1, bar.lwd=2)


[Package plgraphics version 1.1 Index]