errorbar | R Documentation |
Draws symmetric error bars in x- and/or y-direction.
errorbar(x, y, xerr = NULL, yerr = NULL,
bar.col = "red", bar.len = 0.01,
grid = TRUE, with = TRUE, add = FALSE, ...)
x, y |
x-, y-coordinates |
xerr, yerr |
length of the error bars, relative to the x-, y-values. |
bar.col |
color of the error bars; default: red |
bar.len |
length of the cross bars orthogonal to the error bars; default: 0.01. |
grid |
logical; should the grid be plotted?; default: true |
with |
logical; whether to end the error bars with small cross bars. |
add |
logical; should the error bars be added to an existing plot?; default: false. |
... |
additional plotting parameters that will be passed to the
|
errorbar
plots y
versus x
with symmetric error bars,
with a length determined by xerr
resp. yerr
in x- and/or
y-direction. If xerr
or yerr
is NULL
error bars in
this direction will not be drawn.
A future version will allow to draw unsymmetric error bars by specifying
upper and lower limits when xerr
or yerr
is a matrix of
size (2 x length(x))
.
Generates a plot, no return value.
plotrix::plotCI
, Hmisc::errbar
## Not run:
x <- seq(0, 2*pi, length.out = 20)
y <- sin(x)
xe <- 0.1
ye <- 0.1 * y
errorbar(x, y, xe, ye, type = "l", with = FALSE)
cnt <- round(100*randn(20, 3))
y <- apply(cnt, 1, mean)
e <- apply(cnt, 1, sd)
errorbar(1:20, y, yerr = e, bar.col = "blue")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.