s-news
[Top] [All Lists]

[S] Control of command line graphics

To: s-news@wubios.wustl.edu
Subject: [S] Control of command line graphics
From: Murray Efford <EffordM@landcare.cri.nz>
Date: Fri, 29 Oct 1999 10:28:06 +1200
Sender: owner-s-news@wubios.wustl.edu
I am using S+2000 to simulate and graph a dynamic spatial
point pattern xy in which the points are fixed but their state
changes. For example:

xy <- cbind(runif(1000),runif(1000))
z <- sample (size=1000, c(0,1),replace=T)
newstate <- function (z) 1-z # for example

for (i in 1:100) { 
z <- newstate(z)
plot (xy[z==0,],col=1)
points(xy[z==1,],col=2)
}

or 

plot (xy,type='n')
for (i in 1:100) { 
z <- newstate(z)
points (xy[z==0,],col=1)
points (xy[z==1,],col=2)
}

The first option creates a new graph page for each plot,
which might be handy but in this case becomes unwieldy.
Under the second option the plot grows at each step and
becomes very slow to redraw.

Can anyone suggest how I can display the evolving pattern
without incurring these side effects? Also, where one has
numerous pages on the one graphsheet, is there a key
combination for scrolling between pages without
mouse-clicking?

Murray Efford
Landcare Research
Dunedin NZ
effordm@landcare.cri.nz
-----------------------------------------------------------------------
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

<Prev in Thread] Current Thread [Next in Thread>
  • [S] Control of command line graphics, Murray Efford <=