Re: [R] Creating error bars in scatterplot() function (cars-Package)

From: David Winsemius <>
Date: Wed, 30 Mar 2011 17:32:23 -0500

On Mar 30, 2011, at 5:10 PM, philsen wrote:

> Dear list,
> I am new to R and trying to create a grouped (four groups) scatter
> plot with error bars (only in y-direction) using the scatterplot()
> function from the car package.
> The code I am using for plotting the scatter plot is:
> scatterplot(a$s_profile~a$s_plot | a$group, data=a)
> which gives me a nice grouped scatter plot. However I have no idea
> how to insert error bars. Using errbar() from the Hmisc Package
> gives some unwanted results, e.g. adding new points with an offset
> in xy(!?) even when specifying the xlim/ylim parameters.

Generally people use the arrows function for error bars when working in base graphics.

> Another problem is to move/orientate the plotted legend
> individually, is there any possibility?
> I would appreciate your help in solving my problems.

David Winsemius, MD
Heritage Laboratories
West Hartford, CT mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Wed 30 Mar 2011 - 22:35:58 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 30 Mar 2011 - 22:50:25 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive