[R] Mouse Location on Plots

Duncan Murdoch murdoch at stats.uwo.ca
Mon Oct 8 16:48:40 CEST 2007


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



More information about the R-help mailing list