Display Cursor Location

版本 1.0.0.0 (2.4 KB) 作者: Rodney Thomson
Display cursor coordinates within a plot axes window
3.1K 次下载
更新时间 2008/7/30

查看许可证

Display the current cursor coordinates within the bounds of a plot axes.

Assigned as a WindowButtonMotionFcn callback function. Only updates when mouse is moved over plot contents.

To use (See screenshot):

t = linspace(-5,5);
y = sinc(t);
f = figure;
plot(t, y, 'r');

set(f, 'WindowButtonMotionFcn', @(obj, event)cursorLocation(obj, event, 'BottomLeft', ' X: %.3f\n Y: %.3f', 'r'))

For more information:
http://iheartmatlab.blogspot.com/2008/07/display-cursor-coordinates.html

引用格式

Rodney Thomson (2024). Display Cursor Location (https://www.mathworks.com/matlabcentral/fileexchange/20892-display-cursor-location), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R14SP3
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Visual Exploration 的更多信息
致谢

启发作品: stackobj, dtmcursor

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.0.0.0

Link to blog entry