Last active
January 19, 2018 11:13
-
-
Save erikhuizinga/589f0c5b216f4abd9dceb466ee9c0033 to your computer and use it in GitHub Desktop.
Demo of how to add data cursor labels to any point in a graph
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% Demo of how to add data cursor labels to any point in a graph | |
clear | |
close all | |
x = 1 : 10; | |
y = randn(size(x)); | |
f = figure; | |
dcm = datacursormode(f); | |
l = plot(x, y); | |
for i = 1 : numel(x) | |
t = dcm.createDatatip(l); | |
t.Cursor.DataIndex = i; | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment