Skip to content
Prev 315873 / 398506 Next

change confidence interval line length in barplot2 (plotrix package)

Maybe a fortunate mistake. If you use the base graphics barplot(), you can
use plotCI() in plotrix to add the confidence intervals with control over
the width of the horizontal ends of the bars (if needed, the defaults are
much narrower):

out <- barplot(hh, beside = TRUE,
   col = c("lightblue", "mistyrose", "lightcyan", "lavender"),
   legend = colnames(VADeaths), ylim = c(0, 20),
   main = "Death Rates in Virginia", font.main = 4,
   sub = "Faked 95 percent error bars", col.sub = mybarcol,
   cex.names = 1.5)
plotCI(out, hh, pch="", gap=0, ui=ci.u, li=ci.l, add=TRUE)

----------------------------------------------
David L Carlson
Associate Professor of Anthropology
Texas A&M University
College Station, TX 77843-4352