How do I continuously read the mouse position as the mouse is moving only on axes on a figure
4 次查看(过去 30 天)
显示 更早的评论
Hi,
I want to read and show the mouse position continuously on my figure. But I want to show it only when the mouse is on the axes and not on the figure.
How can I do it?
0 个评论
采纳的回答
Jan
2019-1-21
Use the 'WindowButtonMotionFcn' and display the changes only, when the mouse is over the axes. You can do this either by comparing the coordinates or maybe by the undocumented function hittest(FigHandle), which replies the object is mouse is over.
See also: https://www.mathworks.com/matlabcentral/answers/219797-check-if-mouse-is-above-an-axes, especially the command overobj.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Migrate GUIDE Apps 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!