How to add a subscript to a plot of ordered pairs in the order in which they are plotted.
5 views (last 30 days)
Show older comments

I want each ordered pair to have a subscript of when it was added. Ex: The ordered pair (0,1) would have a 2 next to the plotted point.
0 Comments
Accepted Answer
William Rose
on 13 Apr 2023
A=[1,1; 0,1; 0,0; .5,.5; .5,1.5];
labels=string(1:length(A));
plot(A(:,1),A(:,2),'bo')
xlabel('u'); ylabel('v')
text(A(:,1),A(:,2),labels,'VerticalAlignment','top','HorizontalAlignment','left')
Try it.
2 Comments
More Answers (0)
See Also
Categories
Find more on 2-D and 3-D Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!