How to label each data point in a MatLab plot, like the following figure?
![label data in MatLab plot label data in MatLab plot](https://www.alivelearn.net/wp-content/uploads/2015/04/label_data.png)
MatLab code:
x = [1:10]; y = x + rand(1,10); figure('color','w'); plot(x,y,'o'); 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:
![label data 3d label data 3d](https://www.alivelearn.net/wp-content/uploads/2015/04/label_data_3d.png)
Perfect answer, thank you
Thanks a lot. Your article helped me.