[R] locator() in a multiple plot setting

From: Christoph Lehmann <christoph.lehmann_at_gmx.ch>
Date: Tue 13 Jul 2004 - 21:36:05 EST


Hi

based on some code from Thomas Petzoldt, I have a question:

---
opar <- par(mfrow = c(2,4))
slices <- 8
m <- matrix(runif(100),10,10)
my.list <- list()
for (slice in 1:slices) {
     my.list[[slice]] <- m

}
for (slice in 1:slices) { x <- 1*(1:25) y <- 1*(1:25) z <- my.list[[slice]] image(list(x = 0:9, y = 0:9, z = z))
}
par(opar) #restore device parameters p <- locator(1) c(round(p$x), round(p$y)) --- how can I get the "correct" location in the sense of a 3d info: (a) which slice (p$slice) (b) p$x (c) p$y so that it could be used in the sense of: my.list[[p$slice]][round(p$x), round(p$y)] many thanks Cheers christoph ______________________________________________ R-help@stat.math.ethz.ch mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Tue Jul 13 21:44:21 2004

This archive was generated by hypermail 2.1.8 : Fri 18 Mar 2005 - 02:35:49 EST