[R] abline; setting plot limits

Rolf Turner r.turner at auckland.ac.nz
Sun Jun 15 22:54:41 CEST 2014

On 15/06/14 15:34, Paul Rydelek wrote:
> Relatively new user with a question regarding abline.
> I want to draw a st. line fit to some data but I want the line to span the
> range of the x-data and NOT the plot limits.
> In short the line spans xmin to xmax(of plot axis) but I want it to span
> xmin to xmax (of x data).
> Can this but done with abline or do I have to use lines and construct the
> line from a+bx?

A function with this capability was posted by Remko Duursma on 22/1/09. See:

> http://article.gmane.org/gmane.comp.lang.r.general/137344/match=ablinepiece


Rolf Turner

P. S.  Jim: Perhaps this function could/should be added to plotrix.  If 
you are interested, I have written a help file for it.

R. T.

More information about the R-help mailing list