ErrBars(from, to = NULL, pos = NULL, mid = NULL, horiz = FALSE, col = par("fg"), lty = par("lty"), lwd = par("lwd"), code = 3, length = 0.05, pch = NA, cex.pch = par("cex"), col.pch = par("fg"), bg.pch = par("bg"), ...)
to
is left to NULL
and from
is a $k x 2$ dimensional matrix, the first column will be interpreted as from
and the second as to
.from
and to
.x0[i]
, y0[i]
) and if code = 2
an arrowhead is drawn at (x1[i]
, y1[i]
).
If code = 3
(default) a head is drawn at both ends of the arrow. Unless length = 0
, when no head is drawn.mid
. If mid
is left to NULL
the points will be plotted in the middle of from
and to
. No points will be plotted if this is set to NA, which is the default.
par("cex")
.par("fg")
.
par("bg")
.arrows
function.arrows
.lines.loess
par(mfrow=c(2,2))
b <- barplot(1:5, ylim=c(0,6))
ErrBars(from=1:5-rep(0.5,5), to=1:5+rep(0.5,5), pos=b, length=0.2)
# just on one side
b <- barplot(1:5, ylim=c(0,6))
ErrBars(from=1:5, to=1:5+rep(0.5,5), pos=b, length=0.2, col="red", code=2, lwd=2)
b <- barplot(1:5, xlim=c(0,6), horiz=TRUE)
ErrBars(from=1:5, to=1:5+rep(0.2,5), pos=b, horiz=TRUE, length=0.2, col="red", code=2, lwd=2)
par(xpd=FALSE)
dotchart(1:5, xlim=c(0,6))
ErrBars(from=1:5-rep(0.2,5), to=1:5+rep(0.2,5), horiz=TRUE, length=0.1)
Run the code above in your browser using DataLab