error.bar: Draw Error Bars

View source: R/error.bar.R

error.barR Documentation

Draw Error Bars

Description

Draw error bars with specified error levels at the specified coordinates.

Usage

error.bar(
  x,
  y,
  sigma,
  lower,
  upper,
  polygon = FALSE,
  col = "grey30",
  border,
  add = TRUE,
  ...
)

Arguments

x

Horizontal coordinates.

y

Central value(s) or lower and upper bound(s).

sigma

Error deviation from y to be used to define the lower and upper error bounds.

lower

Lower error bound or deviation (if sigma is specified).

upper

Upper error bound or deviation (if sigma is specified).

add

Logical value specifying whether the error bars are to be added to the current plot (Default is TRUE).

Examples

# Constant error:
error.bar(1:10, y = rnorm(10), sigma = 2, add = FALSE)
 
# Variable error:
error.bar(1:10, y = rnorm(10), sigma = 0.5 + runif(10), add = FALSE)

# Explicit bounds:
error.bar(1:10, lower = 2, upper = 2 + runif(10), add = FALSE)


TobieSurette/gulf.graphics documentation built on Feb. 10, 2024, 10:58 p.m.