Skip to content
Prev 77821 / 398502 Next

grid.locator

If I do:

library(lattice)
x <- 1:10
xyplot(x ~ x)
grid.locator()

and click on 2,2 say the I get this:
$x
[1] 201native

$y
[1] 476native

How do I get the user coordinates of the graph?

(If I did not use lattice/grid I could have just done:

plot(x ~ x)
locator()

and it would have worked as expected.)