[R] Difficulty with formatting scatter.smooth output

2007-04-13 Thread Bing Ho
Hello,

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.

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Difficulty with formatting scatter.smooth output

2007-04-13 Thread Greg Snow
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
Intermountain Healthcare
[EMAIL PROTECTED]
(801) 408-8111
 
 

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of Bing Ho
 Sent: Friday, April 13, 2007 10:41 AM
 To: [EMAIL PROTECTED]
 Subject: [R] Difficulty with formatting scatter.smooth output
 
 Hello,
 
 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.
 
 __
 [EMAIL PROTECTED] mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide 
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Difficulty with formatting scatter.smooth output

2007-04-13 Thread J . delasHeras

Quoting Bing Ho [EMAIL PROTECTED]:


Hello,

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.


Hi Bing,

I had exactly the same requirement, so I modified the original  
function where you can specify different colours, line widths, etc...  
(and you can easily add other parameters the same way). I'm attaching  
my version here, in case it saves you 2 minutes of typing :-)


Jose

--
Dr. Jose I. de las Heras  Email: [EMAIL PROTECTED]
The Wellcome Trust Centre for Cell BiologyPhone: +44 (0)131 6513374
Institute for Cell  Molecular BiologyFax:   +44 (0)131 6507360
Swann Building, Mayfield Road
University of Edinburgh
Edinburgh EH9 3JR
UK
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.