areaPlot: Shaded Area Plot

View source: R/areaPlot.R

areaPlotR Documentation

Shaded Area Plot

Description

Produces a plot where the area between lines is filled with color.

Usage

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))

Arguments

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 TRUE, then log transform y axis.

yaxis.range

set y-axis range. See Details.

xaxis.log

logical, if TRUE, then log transform x axis.

xaxis.range

set x-axis range. See Details.

ylabels

set up y-axis labels. See linearPretty for details.

xlabels

set up x-axis labels. See linearPretty for details.

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 setGraph if appropriate.

Details

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.

Value

Information about the graph.

See Also

addArea, smwr.colors, heat.colors

Examples

## 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)

USGS-R/smwrGraphs documentation built on Oct. 11, 2022, 6:11 a.m.