[R] How to set the limit of abline (regression line of lm)

Greg Snow Greg.Snow at imail.org
Mon Sep 20 18:55:50 CEST 2010


Look at the clip function for one approach.  You specify the clipping region, then do abline and it only shows up in the region specified.

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at imail.org
801.408.8111


> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of elaine kuo
> Sent: Monday, September 20, 2010 3:32 AM
> To: r-help at r-project.org
> Subject: [R] How to set the limit of abline (regression line of lm)
> 
> Dear List,
> 
> 
> 
> I ran a regression model using lm and produced a regression line using
> abline.
> 
> 
> The line ranges from -20 to 20 in x axis,
> 
> and the section I only want is from -20 to 0.
> 
> 
> 
> Please kindly advise any function in abline () to set the range of x
> axes.
> 
> Thank you
> 
> 
> 
> Elaine
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org 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.



More information about the R-help mailing list