Path: news.mathworks.com!not-for-mail
From: "Ilya Rozenfeld" <rozeni.nospam@alum.rpi.edu>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Getting pointer position within axes
Date: Tue, 26 Feb 2008 20:49:02 +0000 (UTC)
Organization: Citizens Bank
Lines: 40
Message-ID: <fq1tvu$mr3$1@fred.mathworks.com>
References: <fq1jal$jg7$1@fred.mathworks.com>
Reply-To: "Ilya Rozenfeld" <rozeni.nospam@alum.rpi.edu>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1204058942 23395 172.30.248.35 (26 Feb 2008 20:49:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 26 Feb 2008 20:49:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1195850
Xref: news.mathworks.com comp.soft-sys.matlab:453865



Check help for "WindowButtonMotionFcn" and "CurrentPoint".

In the callback for WindowButtonMotionFcn you can query 
cursor position (in the figure coordinates) using 
CurrentPoint property and if it is close enough to your 
object then trigger some event.


"Michelle " <mkline@egi.utah.edu> wrote in message 
<fq1jal$jg7$1@fred.mathworks.com>...
> Hello,
> 
> Here is what I would like to do:
> 
> When my mouse rolls over a plot object in an axes, I 
want to
> plot some text that identifies the object, directly next 
to
> the object.  I don't want to have to click on the object 
to
> make this text display in the axes.  I just want to roll
> over the object.  
> 
> I have the Image Processing Toolbox installed, and have
> tried working with iptPointerManager to accomplish the
> desired task.  However, the iptPointerManager seems to
> maintain only the pointer's current position in the 
figure,
> and in pixels.  I don't know how to translate the pointer
> position (in pixels, with respect to the figure) to the
> location of the plotted object (in data units, with 
respect
> to the axes).
> 
> Can anyone suggest a solution?
> 
> Thank you,
> 
> Michelle Kline