File Exchange

image thumbnail

Data cursors for figure window

version (8.76 KB) by Malcolm Lidierth
Data cursor support for multiple axes in a fugure


Updated 24 May 2011

View License

Several related functions:

CreateCursor sets up a vertical cursor on all axes in a figure. The cursors can be moved around using the mouse.
Multiple cursors are supported in each figure

GetCursorLocation returns the location of a cursor while SetCursorLocation sets it.

DeleteCursor removes a cursor.

Objects belonging to each cursor have their handles stored in the figure application data area. Callbacks for each object serve to link their position on the axes.

Cite As

Malcolm Lidierth (2020). Data cursors for figure window (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (7)

Eric Hong

I can't move the cursors with the mouse. I'm using 2018b. Is this function working with the version?

Looks very good, but I have problems using it with GUIDE.

After creating two cursors in the OpeningFcn, I cannot move them. I have tried to save the cursors and pass them to the figure ButtonDownFcn , but nothing happens. Any hint?


Horizontal cursors would also be extremely useful!

Update posted. This is more flexible. Axes in a GUI should be OK - though I do not use GUIDE so have not checked that.


Thanks! This is great. Is there any way to implement this inside a GUI?


Great ! I That is exactly what I need !

Thanks a lot

charli chen

very good and useful. However, the cursor will meet some problems when you zoom in/out, or move the figure.


Improved functionality

Minor improvements

MATLAB Release Compatibility
Created with R2006b
Compatible with any release
Platform Compatibility
Windows macOS Linux