Hi
Gabor Grothendieck wrote:
If I do:
library(lattice)
x <- 1:10
xyplot(x ~ x)
After the lattice plot, you are back at the top-level grid viewport.
grid.locator()
and click on 2,2 say the I get this:
$x
[1] 201native
$y
[1] 476native
grid.locator() by default gives you the click in "native" coordinates.
The "native" coordinates for the top-level viewport depend on the
device; on-screen it is pixel-based.
How do I get the user coordinates of the graph?
Look up the lattice function trellis.focus().
Paul
(If I did not use lattice/grid I could have just done:
plot(x ~ x)
locator()
and it would have worked as expected.)