[R] Difficulty with formatting scatter.smooth output
Greg.Snow at intermountainmail.org
Fri Apr 13 18:52:55 CEST 2007
>From looking at ?scatter.smooth it appears that scatter.smooth uses the
function loess.smooth to calculate the smoothed line. So you could
create your own scatterplot using the plot function, then call
loess.smooth and use the lines function (with whatever parameters you
want) to add the line to the scatter plot.
This gives you as much control as you want over any of the details.
Hope this helps,
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
greg.snow at intermountainmail.org
> -----Original Message-----
> From: r-help-bounces at stat.math.ethz.ch
> [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Bing Ho
> Sent: Friday, April 13, 2007 10:41 AM
> To: r-help at stat.math.ethz.ch
> Subject: [R] Difficulty with formatting scatter.smooth output
> I have been using scatter.smooth and been trying to format my
> plots and been unable to adjust the line type or color of the
> smooth curve.
> When I specify col in scatter.smooth, I can adjust the color
> of the scatter plot points, but the line always stays black
> and solid. lty has no effect.
> When I specify par prior to calling scatter.smooth, col will
> change the color of the points, smoothed line, and bounding
> box. lty, col.axis, col.lab work as expected.
> What I would like to be able to do is format each element of
> the graph specifically - bounding box, points, and smoothed curve.
> Thank you for any advice.
> R-help at stat.math.ethz.ch mailing list
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help