addArea | R Documentation |
Adds a filled polygon (area) to a graph.
addArea(x, y, ybase = NULL, Area = list(name = "", color = "gray", outline = "black"), current = list(yaxis.log = FALSE, yaxis.rev = FALSE, xaxis.log = FALSE))
x |
the x-axis coordinates of the polygon. Missing values are not permitted. |
y |
the y-axis coordinates of the polygon. Missing values are not permitted. |
ybase |
the y-axis coordinates of the polygon. See Details. Missing values are not permitted. |
Area |
parameters defining the characteristics of the area. See
|
current |
the current plot information. Typically, this would be the
output from one of the graph creation functions like |
If ybase
is NULL, then x
and y
should form a complete
polygon, which can be closed or open. Otherwise, ybase
can be a single
value in which case the area between ybase
and y
is treated as
the area, or ybase
can be a vector as long as y
and the area
between is treated as the area to be shaded.
The current plot information is returned invisibly.
areaPlot
, addXY
, xyPlot
## Not run: set.seed(1) X <- seq(1, 9, by=.5) Y <- runif(17) + runif(17) setGD() AA.pl <- xyPlot(X, Y, Plot=list(what="none")) addArea(X, Y, ybase=0, current=AA.pl) # For more details of addArea see vignette(topic="GraphSetup", package="smwrGraphs") demo(topic="DurationHydrograph", package="smwrGraphs") ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.