|
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
"Ilya Rozenfeld" <rozeni.nospam@alum.rpi.edu> wrote in
message <fq1tvu$mr3$1@fred.mathworks.com>...
> 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
>
|