Boxplot positions and labels are not the same thing.
You have groups 'called' "2", "3", "4". As factors - which is what bocplot will 
turn them into -  they will be treated as arbitrary labels and _numbered_ 1:3 
(try as.numeric(factor(x)). 

So your lm() used 2:4, but your plot (and abline) uses 1:3 for positions and 
"2" - "4" as labels. 

The best option used to be to plot the boxes at positions 2:4. Look at the at= 
parameter in boxplot.
But that is now of little help because there is no way of overriding xlim, 
leaving you no alternative but to reformulate your model with an offset or 
something. 

I will take up the boxplot xlim issue separately on R-dev; it's not the only 
such.

Steve Ellison.

>>> "Brian Wilfley" <[EMAIL PROTECTED]> 21/06/2007 22:44:17 >>>
I'm trying to add lines to a plot originally made with "boxplot", but
the lines appear in the wrong place. 

*******************************************************************
This email and any attachments are confidential. Any use, co...{{dropped}}

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to