areaPlot | R Documentation |
Produces a plot where the area between lines is filled with color.
areaPlot(x, y, Areas = list(name = "Auto", fillDir = "between", base = "Auto", lineColor = "black", fillColors = "pastel"), yaxis.log = FALSE, yaxis.range = c(NA, NA), xaxis.log = FALSE, xaxis.range = c(NA, NA), ylabels = 7, xlabels = "Auto", xtitle = "", ytitle = "", caption = "", margin = c(NA, NA, NA, NA))
x |
numeric x-axis coordinates in increasing order. |
y |
a numeric matrix of y-axis coordinates. |
Areas |
parameters controlling the areas. See Details. |
yaxis.log |
logical, if |
yaxis.range |
set y-axis range. See Details. |
xaxis.log |
logical, if |
xaxis.range |
set x-axis range. See Details. |
ylabels |
set up y-axis labels. See |
xlabels |
set up x-axis labels. See |
xtitle |
the x-axis title (also called x-axis caption). |
ytitle |
the y-axis title (also called y-axis caption). |
caption |
the caption for the graph. |
margin |
set the plot area margins, in units of lines of text. Generally
all NA or the output from |
The components of Areas
are name
, the name or names
to use to describe the areas in the explanation, the default "Auto" generates
names from the column names of y
; fillDir
, how to
fill—must be either "between" or "under;" base
, the base value when
fillDir
is "under," can be "Auto" to draw to the x-axis or any numeric value;
lineColor
specifies the color to draw the lines around each area, may be
"none" for no line drawn; fillColors
specifies colors for each area, when only
a single area is drawn, then the value must be the name of a color, otherwise either a
vector of colornames or the prefix name of a function that generates a sequence of
colors. The prefix name is prepended to ".colors" for the name of the function. See the
documentation for these functions in the See Also section.
For linear axes, the range can be set to virtually any pair of values. For log axes, the choice of range is more resticted—for less than one log-cycle, powers of whole numbers can be used; from 1 to about 3 log cycles, the choces should be powers of 3 or 10; and for more than 3 log cycles, the range sould be expressed only in powers of 10.
Information about the graph.
addArea
, smwr.colors
,
heat.colors
## Not run: set.seed(1) X <- seq(1, 9, by=.5) Y <- runif(17) + runif(17) setGD() # The default fillDir, between, requires at least a 2-column matrix areaPlot(X, cbind(rep(0, 17),Y)) # For more details of areaPlot see vignette(topic="GraphGallery", package="smwrGraphs") ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.