graphFilledBand: Fill the area between two curves on a graph.

Description Usage Arguments Details Customizing plot lines See Also Examples

Description

Fill the area between two curves on a graph. Useful for confidence limits, for example.

Usage

1
2
graphFilledBand(x, y1, y2, fillcol = "gray", add = TRUE,
  linecol = "black", ltype = "solid", lwidth = 1)

Arguments

x

The x axis values.

y1, y2

Two sets of y axis values, each of exactly the same length as x.

fillcol

The color filling the area between the two curves.

add

Logical. Whether to add elements such as points or line to an existing graph. if TRUE, there must be an appropriate existing graph, otherwise, a new graph is drawn.

linecol

Line colour.

ltype

Line type; see ltype in ?graphics::par().

lwidth

Line width; see width in ?graphics::par().

Details

Typical use is to draw a graph first with some central y values, then add a confidence band by filling the area between upper and lower confidence limits (designated by variables lower.y and upper.y in the example below). The central line should then be redrawn over the filled area.

Customizing plot lines

If add == TRUE, linecol, ltype and lwidth are ignored.

See Also

?graphics::plot(), ?graphics::par().

Examples

1
2
3
4
5
6
## Not run: 
plot(x, y, type = 'l')
graphFilledBand(x, lower.y, upper.y)
lines(x, y)

## End(Not run)

forestgeo/ctfs documentation built on May 3, 2019, 6:44 p.m.