[R] Mouse Location on Plots

Greg Snow Greg.Snow at intermountainmail.org
Mon Oct 8 21:06:03 CEST 2007


Another option (which should work on all platforms) is to use tcltk and
bind a function to the "Motion" event.  The playSudoku function in the
sudoku package has an example of this (as well as using
getGraphicsEvent).

(wow, could that package actually be useful?)

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at intermountainmail.org
(801) 408-8111
 
 

> -----Original Message-----
> From: r-help-bounces at r-project.org 
> [mailto:r-help-bounces at r-project.org] On Behalf Of Duncan Murdoch
> Sent: Monday, October 08, 2007 8:49 AM
> To: Samuel Kemp
> Cc: r-help at stat.math.ethz.ch
> Subject: Re: [R] Mouse Location on Plots
> 
> On 08/10/2007 8:42 AM, Samuel Kemp wrote:
> > Hi,
> > 
> > Does anyone know of a function that dynamically updates a variable 
> > with the
> > (x,y) co-ordinates of the mouse pointer on a plot?
> > 
> > locator and identify only return the values when you click 
> 'stop' on 
> > the graphics device.
> > 
> > Any help would be gratefully appeciated.
> 
> See getGraphicsEvent, if you're using the windows() device, 
> or rgl.setMouseCallbacks if you're using rgl.
> 
> Duncan Murdoch
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide 
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
> 



More information about the R-help mailing list