getting coordinates from gui axes
4 views (last 30 days)
Show older comments
Hi,
I work with a GUI includes axes ( matlab2016a ),
I already activated the datacursor in gui side (from toolbar),
I can see coordinates when I click to graph,
But I want to get coordinates of mouse click, I mean reading the values, x and y,
I try with cp = get(gca,'CurrentPoint');
Does not work.
Can anyone help?
Regards.
1 Comment
Answers (1)
Purushottama Rao
on 27 Jan 2017
Edited: Purushottama Rao
on 27 Jan 2017
You can use one of these commands to read the data on mouse click.
[x, y] = getpts(fig)
or
[x, y] = getpts(ax)
3 Comments
Purushottama Rao
on 27 Jan 2017
Edited: Purushottama Rao
on 27 Jan 2017
You can use 'enter' after the selection of required number of data points.
See Also
Categories
Find more on 2-D and 3-D Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!