Re: [R] color under lm line

From: Dieter Menne <>
Date: Tue, 15 Mar 2011 06:21:35 -0700 (PDT)

Marlin Keith Cox wrote:
> Thank you, but I need only the area under the llm colored. What if there
> were two lm lines?
For the well-behaved case you could find the range to be colored with

range = which(diff(resid(llm)>0)!=0)


range = which(diff(resid(llm)>0)!=0)
co <- coef(llm)
bord <- pmin(y, co[1] + co[2] * x)
r1 = range[1]
r2 = range[2]

        col = 'red')

View this message in context:
Sent from the R help mailing list archive at

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Tue 15 Mar 2011 - 13:24:33 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 Tue 15 Mar 2011 - 13:40:21 GMT.

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

list of date sections of archive