0

I'm developing a GUI in Matlab that presents a plot (in an axis object). When clicking on a point in the plot, the GUI will open some other plots for that data point.

I added an axis object to my figure and implement the WindowButtonDownFcn to get a button click. I can get the mouse position with

 pos=get(hObject,'CurrentPoint');

but how do I convert it to values in my plot? (i.e. which x-value was clicked on)

thanks.

(I'd be happy to hear if there is some simpler way to do this, instead of writing my own GUI)

Ran
  • 4,117
  • 4
  • 44
  • 70
  • @EitanT - thanks, that worked. I just had to put the axes handle in the get. write your comment as answer so I can mark it. – Ran Jul 10 '12 at 20:04

1 Answers1

1

Try looking up the help on ginput and then set that to some variable. Then plot the points for the number of ginputs you've done.

A lot of it is explained here: http://www.mathworks.com/help/techdoc/ref/ginput.html

strawberry
  • 11
  • 3