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
|