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.augPredfunction in nlme is based onxyplotin the lattice package(see the help page forplot.augPredfor 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 ofxyplotandpanel.xyplotas 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
augPredobject and create a plot from scratch. But you can certainly control the plot settings via thepar.settingsargument fromxyplot.Here is an example, using the
plot.augPredhelp page example. Consider including a reproducible example in the future.You can control colors line widths with
superpose.lineandplot.symbolto control the symbols. If you want to get rid of the symbols all together you can setpchtoNA.Notice this failed to change the legend output, though, and so still needs some work.