On Tue, 27 Mar 2001, David M Smith wrote:
> If you are using barplot(), one tricky aspect is understanding the x
> coordinates. Using width=0.8 and space=0.25 ensures the right-hand edge of
> each bar is at coordinates 1,2,3,... which makes adding the error bars
> easier.
> For example:
better yet, use the return value from "barplot"
[modified]
y <- runif(10, 5,10)
err <- runif(10,0,2)
temp <- barplot(y,ylim=c(0,13), col=5)
error.bar(temp,y,err,add=T,gap=F)
The last 2 lines could easily be wrapped into a function with a command to
compute the errors you want shown.
While the GUI has a quick and easy error bar plot, you have to look at the
docs or the options to find out what the error bars are showing. If you
do it by hand then you know exactly what went into computing them.
--
Greg Snow, PhD Office: 223A TMCB
Department of Statistics Phone: (801) 378-7049
Brigham Young University Dept.: (801) 378-4505
Provo, UT 84602 email: gls@byu.edu
|