Display Cursor Location

Display cursor coordinates within a plot axes window
3,1K Downloads
Aktualisiert 30. Jul 2008

Lizenz anzeigen

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

Zitieren als

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

Kompatibilität der MATLAB-Version
Erstellt mit R14SP3
Kompatibel mit allen Versionen
Plattform-Kompatibilität
Windows macOS Linux
Kategorien
Mehr zu Visual Exploration finden Sie in Help Center und MATLAB Answers
Quellenangaben

Inspiriert: stackobj, dtmcursor

Community Treasure Hunt

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

Start Hunting!
Version Veröffentlicht Versionshinweise
1.0.0.0

Link to blog entry