Draw polygons

Description

Draw a closed polygon delineated by an 'upper' and 'lower' y limit.

Usage

1
    drawpoly(x, upper, lower, ...)

Arguments

x

The x values of the polygon

upper

The upper 'edge' of the polygon

lower

The lower 'edge' of the polygon

...

Other arguments passed to polygon

Details

drawpoly is a generic method for drawing polygons where the polygon is drawn as:

polygon(x=c(x, rev(x), x[1]), y=c(upper, rev(lower), upper[1])

i.e. a line following along the top edge (left-to-right along x) and back along the bottom edge (right-to-left along x).

The specific method implemented here for FRAIR is drawpoly.frboot.

Author(s)

Daniel Pritchard

See Also

drawpoly.frboot

Examples

1
2
3
4
5
6
datx <- 1:6
upper <- datx*1.2
lower <- datx*0.8
plot(datx, datx, type='n', ylim=c(0,10), xlab='X', ylab='Y')
drawpoly(datx, upper, lower, col=2)
points(datx, datx, pch=20)