Polyplot: Draw error shading

Description Usage Arguments Author(s) See Also Examples

View source: R/Polyplot.R

Description

A wrapper function for the polygon function to draw error shadings (or confidence intervals) on a line plot.

Usage

1
Polyplot(x, y1, y2, col = "black", alpha = 0.2, ...)

Arguments

x

numeric vector of x values of the error band.

y1

numeric vector for the upper bound of the error band; must be of the same length as x.

y2

numeric vector for the lower bound of the error band; must be of the same length as x.

col

colour of the error band.

alpha

opacity factor for col within [0,1].

...

additional parameters which are passed to polygon.

Author(s)

Thomas Münch

See Also

polygon

Examples

1
2
3
4
x <- 1 : 10
plot(x, type = "n", xlab = "x", ylab = "y")
Polyplot(x, y1 = x + 2, y2 = x - 2)
lines(x, lwd = 2)

EarthSystemDiagnostics/ecustools documentation built on Jan. 15, 2022, 5:22 p.m.