Path: news.mathworks.com!not-for-mail
From: "sourabh bora" <borasourabh1@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Getting pointer position within axes
Date: Sun, 16 Mar 2008 21:49:03 +0000 (UTC)
Organization: University of Rochester
Lines: 30
Message-ID: <frk4kf$ahk$1@fred.mathworks.com>
References: <fq1jal$jg7$1@fred.mathworks.com> <fq1tvu$mr3$1@fred.mathworks.com> <fq1vcu$f80$1@fred.mathworks.com>
Reply-To: "sourabh bora" <borasourabh1@gmail.com>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1205704143 10804 172.30.248.38 (16 Mar 2008 21:49:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 16 Mar 2008 21:49:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1284988
Xref: news.mathworks.com comp.soft-sys.matlab:457533



Hi Michelle,
I am facing the same problem as you.. how to determine the
location of objects within the axes. I would be glad if you
let me know once you find the solution.
 A matlab program called freehanddraw.m can give you some
idea how to work with window mouse button.

  another approach you may try is using ginput. 
http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=7347&objectType=File
Thanks
Sourabh Bpra

"Michelle " <mkline@egi.utah.edu> wrote in message
<fq1vcu$f80$1@fred.mathworks.com>...
> Thanks, Ilya.  
> 
> I now see that I don't have to actually click with my mouse
> to trigger the WindowButtonMotionFcn.  A big problem still
> remains, though.  Now that I've got the cursor position, in
> figure coordinates, how do I determine (programmatically)
> what object my cursor is currently near?  The objects are
> points that I plotted in a graph axes using the plot
> command.  I have no way of telling what each point's
> position is, in terms of figure units.  (Or can I?)  I only
> know each point's position in my data units (for example age
> vs. feet).
> 
> - Michelle
>