Martin Batholdy
2013-Jan-22 18:28 UTC
[R] change confidence interval line length in barplot2 (plotrix package)
Hi, is there any way to change the width of the horizontal line of confidence intervals in the barplot2 function in the plotrix package (independent of the width of the bars)? example code: library(plotrix) # Example with confidence intervals and grid hh <- t(VADeaths)[, 1] mybarcol <- "gray20" ci.l <- hh * 0.85 ci.u <- hh * 1.15 mp <- barplot2(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, plot.ci = TRUE, ci.l = ci.l, ci.u = ci.u) thanks!
Rolf Turner
2013-Jan-22 19:39 UTC
[R] change confidence interval line length in barplot2 (plotrix package)
There does not appear to be any such function as barplot2 in the current version (3.4-5) of the plotrix package. Moreover I can find no reference to such a function in the "NEWS" for plotrix. cheers, Rolf Turner On 01/23/2013 07:28 AM, Martin Batholdy wrote:> Hi, > > is there any way to change the width of the horizontal line of confidence intervals > in the barplot2 function in the plotrix package (independent of the width of the bars)? > > > example code: > > library(plotrix) > # Example with confidence intervals and grid > hh <- t(VADeaths)[, 1] > mybarcol <- "gray20" > ci.l <- hh * 0.85 > ci.u <- hh * 1.15 > mp <- barplot2(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, plot.ci = TRUE, ci.l = ci.l, ci.u = ci.u) >
David Winsemius
2013-Jan-22 20:24 UTC
[R] change confidence interval line length in barplot2 (plotrix package)
On Jan 22, 2013, at 10:28 AM, Martin Batholdy wrote:> Hi, > > is there any way to change the width of the horizontal line of confidence intervals > in the barplot2 function in the plotrix package (independent of the width of the bars)? > > > example code: > > library(plotrix) > # Example with confidence intervals and grid > hh <- t(VADeaths)[, 1] > mybarcol <- "gray20" > ci.l <- hh * 0.85 > ci.u <- hh * 1.15 > mp <- barplot2(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, plot.ci = TRUE, ci.l = ci.l, ci.u = ci.u)When I did an sos::findFn("barplot2") search to locate the "real" `barplot2` O alos noted in the same package (gplots) a function named `ooplot`. It calls itself an extenstion of barplot2 and has a ci.lwd argument. Might save you the time of doing what I thought might be needed, hacking te code. -- David Winsemius Alameda, CA, USA