[R] locator() in a multiple plot setting

2004-07-13 Thread Christoph Lehmann
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]]

Re: [R] locator() in a multiple plot setting

2004-07-13 Thread Barry Rowlingson
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 Okay, purely off the top of my head here... You can use par()$usr, par()$plt, and par()$fig to transform from locator()'s coordinates to device