I am trying to use a grouped data to fit and then plot plot(augPred(fit)). However, I would like to change the line color as it is the similar color of the points. Is there a way to make the lines in a different color? Also, I would like to remove the data points in the plot, just leaving the two fitted lines so it would be easy to compare them. In the figure attached, I would like to remove data points and change the fitted lines color.
Thanks very much for any help. Ravi
The
plot.augPred
function in nlme is based onxyplot
in the lattice package(see the help page forplot.augPred
for more info), so you would have to delve into that package a bit more to see what you can add to change the plot. There is a fair amount of info out there once you start looking, see this link and the help page ofxyplot
andpanel.xyplot
as possible starting places.If it was me and I wanted to make a bunch of changes to the defaults, I'd probably just use the output from the
augPred
object and create a plot from scratch. But you can certainly control the plot settings via thepar.settings
argument fromxyplot
.Here is an example, using the
plot.augPred
help page example. Consider including a reproducible example in the future.You can control colors line widths with
superpose.line
andplot.symbol
to control the symbols. If you want to get rid of the symbols all together you can setpch
toNA
.Notice this failed to change the legend output, though, and so still needs some work.