Tom,
Here is two scripts that I usually use to plot my data and should do what
you want.
The two panel functions correspond to the smooth unction and the loess
function in the programmer's guide. They have many other options in it.
xyplot(Beta~Alpha, # plot Beta vs Alpha
data=dataset, # The dataset where x and y are
panel=function(x,y,...){
panel.smooth(x,y,...)
})
xyplot(Beta~Alpha,
data=dataset,
panel=function(x,y,...){
panel.xyplot(x,y,...)
panel.loess(x,y,...)
})
I hope this can help you,
Vincent
.
VD >-----Original Message-----
VD >From: Thom Burnett [mailto:Thom.Burnett@cognigencorp.com]
VD >Sent: Wednesday, April 27, 2005 2:27 PM
VD >To: S-News
VD >Subject: [S] Plotting Spline within a script
VD >
VD >
VD >How do I add a spline line to an existing scatterplot
VD >within a script.
VD >
VD >My script uses guiCreate() to correctly make my "LinePlot" on the
VD >graphsheet.
VD >I then need to add a spline curve of the same data.
VD >
VD >There's a parameter to guiCreate of Line Plot called
VD >"SmoothingType"
VD >which accepts "Spline" sounds like what I want but the line doesn't
VD >appear on my graph.
VD >
VD >Is there another argument that turns on the Smoothing Type?
VD >
VD >I also tried creating a Spline with guiPlot() but was
VD >unable to get that
VD >to show up on my existing and named graphsheet.
VD >
VD >Any help would be appreciated. Examples are probably best.
VD >
VD >Thom
VD >--------------------------------------------------------------------
VD >This message was distributed by s-news@lists.biostat.wustl.edu. To
VD >unsubscribe send e-mail to
VD >s-news-request@lists.biostat.wustl.edu with
VD >the BODY of the message: unsubscribe s-news
VD >