Re: [R] grid.locator

From: Gabor Grothendieck <ggrothendieck_at_gmail.com>
Date: Mon 26 Sep 2005 - 08:23:30 EST

Thanks. Following the example there worked.

I suggest adding trellis.focus to the See Also in ?grid.locator

On 9/25/05, Paul Murrell <p.murrell@auckland.ac.nz> wrote:
> 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:
> >
> >
> >>grid.locator()
> >
> > $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.)



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Mon Sep 26 08:28:15 2005

This archive was generated by hypermail 2.1.8 : Sun 23 Oct 2005 - 17:43:51 EST