Re: [R] change fitted line colour in lme() trellis plot?

From: Deepayan Sarkar <deepayan.sarkar_at_gmail.com>
Date: Fri 20 Jan 2006 - 09:21:13 EST

On 1/19/06, Deepayan Sarkar <deepayan.sarkar@gmail.com> wrote:
> On 1/19/06, Bill Simpson <william.simpson@drdc-rddc.gc.ca> wrote:
> > If I used a groupedData object, if I do
> > fit<-lme(blah)
> > then
> > plot(augPred(fit))
> > produces a nice trellis plot of the data along with the fitted lines
> >
> > However I find that the lines and the data points are in the same colour
> > (light blue against a medium grey background). Is there a way to make
> > the lines in a different colour (e.g. black)?
>
> plot(augPred(fit), col.line = 'black')
>
> > It would also be nice if
> > the line were plotted after the points so it is visible (I have a lot of
> > points and the line is obscured).
>
> The order is hard-coded in the panel function:
>
> > plot(augPred(fit))$panel
> function (x, y, subscripts, groups, ...)
> {
> if (grid)
> panel.grid()
> orig <- groups[subscripts] == "original"
> panel.xyplot(x[orig], y[orig], ...)
> panel.xyplot(x[!orig], y[!orig], ..., type = "l")
> }

Actually, this is already what you want, so you shouldn't need to do anything.

Deepayan



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 Received on Fri Jan 20 09:28:58 2006

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:42:07 EST