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.s...@imail.org 801.408.8111 > -----Original Message----- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of elaine kuo > Sent: Monday, September 20, 2010 3:32 AM > To: r-help@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@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. ______________________________________________ R-help@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.