View source: R/frair_boot_methods.R
drawpoly | R Documentation |
Draw a closed polygon delineated by an 'upper' and 'lower' y limit.
drawpoly(x, upper, lower, ...)
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 |
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
.
Daniel Pritchard
drawpoly.frboot
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.