[S] making graphs ... faster

Jean Adams (Jean_Adams@usgs.gov)
Thu, 8 Oct 1998 15:44:16 -0600



I just stumbled across something that reduces the time it takes S-PLUS
to produce a graph on my screen, and I thought others might find this
"trick" useful.

I am using S-PLUS 4.5 with Windows 95 and I typically submit commands
to create a graph by copying selected commands from a text file and
pasting them in the commands window. I found that if I enclose the
entire set of graph-producing commands in a set of braces, {}, the
time it takes for S-PLUS to produce the graph on my screen is
substantially reduced. (In the graphs I have been working on today,
real production time was reduced by 56%!) For example instead of
submitting the commands:
graphsheet()
plot(1:100, 10*(1:100))
lines(1:100, 101:200, lty=4)
lines(1:100, 201:300, lty=2)
lines(1:100, 651:750, lty=3)
etc ...
submit the commands:
{
graphsheet()
plot(1:100, 10*(1:100))
lines(1:100, 101:200, lty=4)
lines(1:100, 201:300, lty=2)
lines(1:100, 651:750, lty=3)
etc ...
}

JVA


Jean V. Adams U.S. Geological Survey
e-mail: jean_adams@usgs.gov Great Lakes Science Center
phone: (734) 214-9307 1451 Green Road
FAX: 734-994-8780 Ann Arbor, MI 48105-2899 USA
-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message: unsubscribe s-news