ErrorBars: Add error bars

View source: R/ErrorBars.R

ErrorBarsR Documentation

Add error bars

Description

Add error bars to an existing point plot.

Usage

ErrorBars(
  x,
  y,
  upper,
  lower = upper,
  width = 0.05,
  col = "black",
  lwd = 1,
  lty = 1
)

Arguments

x

x coordinates of the points for which error bars are to be added.

y

y coordinates of the points for which error bars are to be added.

upper

upper value of the error interval relative to y; i.e., the upper end of the error interval extends to y + upper.

lower

same as upper for the lower value of the error interval; default is to assume symmetric error intervals around y.

width

the width of the error bar drawing as a fraction of the x user coordinate range (diff(range(par("usr")[1 : 2]))); defaults to five percent.

col

the colour of the error bars; default "black".

lwd

the line width of the error bars; default 1.

lty

the line type of the error bars; default are solid lines (lty = 1).

Author(s)

Thomas Münch

Examples

x <- 1 : 10
plot(x, ylim = c(0, 12))
ErrorBars(x, y = x, upper = 2, lower = 1)
ErrorBars(x, y = x, upper = 0.5, col = "red", width = 0.025)

EarthSystemDiagnostics/grfxtools documentation built on Aug. 5, 2023, 1:43 p.m.