pointswithslantederror: pointswithslantederror

View source: R/plotutils.R

pointswithslantederrorR Documentation

pointswithslantederror

Description

This function plots points with x- and y-errors visualised as a slanted errorbar. The length of the error bar represents x- and y-errors added in quadrature. The slope of the error bar is positive of negative depending on whether the correlation betwenn x and y is positive or negative, respectively.

Usage

pointswithslantederror(x, y, dx, dy, cor, col = "black", bcol = "black",
  ...)

Arguments

x

numeric vector. x-values

y

numeric vector. y-values

dx

numeric vector. x-standard errors

dy

numeric vector. y-standard errors

cor

numeric vector. Correlation coefficients between x- and y- errors.

col

the color of the points

bcol

the color of the slanted error bars

...

further graphical parameters to be passed on to points

Details

plots data points with slanted error bars

Examples

x <- c(1:5)
y <- x^2
dx <- c(0.1, 0.2, 0.2, 0.1, 0.05)
dy <- c(0.05, 0.2, 0.1, 0.2, 0.1)
cor <- c(1, -1, -1, 1, 1)
plot(NA, xlim=range(x), ylim=range(y), xlab="y", ylab="y")
pointswithslantederror(x=x, y=y, dx=dx, dy=dy, cor=cor)


hadron documentation built on Sept. 9, 2022, 5:06 p.m.