Skip to content

How can I put error bars on a barplot() ?

2 messages · Olivier BUHARD, Marc Schwartz

#
On Tue, 2003-12-23 at 08:04, olivier wrote:
Olivier,

You can use either segments() or arrows() to place error bars on
barplots. 

Also, there is barplot2() in the gregmisc package on CRAN, which
provides this functionality and enables you to pass the error bar values
as arguments to the function.

As you may have noted, if you use either segments() or arrows(), the key
is to get the bar midpoints for proper line placement. The bar midpoints
are returned from the barplot() function and that is described in the
help for barplot().

If you should elect to use barplot2(), let me know if you have any
questions on its use.

Best regards,

Marc Schwartz