plbars: Add bars to a pl plot

plbarsR 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, marpar = NULL, ...)

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

marpar

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

...

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 pl.envir.

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)


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