envelop
eases the computation of the polygons described by to set
of y coordinates along the x-axis. Optionally, the polygons could be added
on the current plot.
envelop(x, upper, lower = rep(0, length(upper)), add = TRUE, ...)
x | vectors containing the x coordinates. |
---|---|
upper | the y coordinates of the upper values. |
lower | the y coordinates of the lower values. |
add | a logical. If |
... | additional arguments to be passed to |
The coordinates of the envelop are returned if assigned.
sz <- 100 seqx <- seq(0, 10, length.out = sz) seqy1 <- 0.2 * seqx * runif(sz, 0, 1) seqy2 <- 4 + 0.25 * seqx * runif(sz, 0, 1) seqy3 <- 8 + 0.25 * seqx * runif(sz, 0, 1) envelop(seqx, seqy1, seqy2, col = 'grey85', border = NA)envelop(seqx, seqy2, seqy3, col = 'grey25', border = NA)