How to label each point in MatLab plot?
18 sec read
How to label each data point in a MatLab plot, like the following figure?
x = [1:10];
y = x + rand(1,10);
a = [1:10]'; b = num2str(a); c = cellstr(b);
dx = 0.1; dy = 0.1;
text(x+dx, y+dy, c);
It also works on 3D plot:
Adopted from http://www.mathworks.com/matlabcentral/answers/97277-how-can-i-apply-data-labels-to-each-point-in-a-scatter-plot-in-matlab-7-0-4-r14sp2
Receive email notification via email
Don't want to miss new papers in your field? Check out Stork we developed: