How can I read the point coordinates from a graphic?
1 次查看(过去 30 天)
显示 更早的评论
I want to read the x and y coordinates of a certain point of the graphic when I click in that point. Is there any way to do it?
Sorry for my bad English!
Thanks
0 个评论
采纳的回答
Image Analyst
2013-4-25
Try ginput:
plot(1:10);
grid on;
uiwait(msgbox('Click a point'));
[x,y] = ginput(1)
2 个评论
Image Analyst
2013-4-25
Have a button with a captions that says something like "Select a point..." and then call that code (put it in the button callback) when the user clicks the button, which indicates that they are ready to specify a point on the axes.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Exploration 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!