Description Usage Arguments Details Customizing plot lines See Also Examples
Fill the area between two curves on a graph. Useful for confidence limits, for example.
1 2 | graphFilledBand(x, y1, y2, fillcol = "gray", add = TRUE,
linecol = "black", ltype = "solid", lwidth = 1)
|
x |
The x axis values. |
y1, y2 |
Two sets of y axis values, each of exactly the same length as
|
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 |
lwidth |
Line width; see |
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.
If add == TRUE
, linecol
, ltype
and lwidth
are ignored.
?graphics::plot()
, ?graphics::par()
.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.