How to mark labels on sampling points

4 views (last 30 days)
Udaya
Udaya on 8 Aug 2022
Commented: Star Strider on 11 Aug 2022
Dear all,
I have a data set with latitude, longitude and sample numeber. I can plot lat and lon in map. My question is how to display sample number on the plot. I will add data set and sample number for your reference

Answers (1)

Star Strider
Star Strider on 8 Aug 2022
I have no idea what you want to plot.
Try this —
T1 = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1091375/locations.csv')
T1 = 15×4 table
Var1 Var2 Var3 Var4 ____ ______ _______ ______ 28 48.659 -48.659 45.534 30 48.617 -48.617 45.693 31 48.514 -48.514 45.625 32 48.411 -48.411 45.547 34 48.373 -48.373 45.513 36 48.174 -48.174 45.384 37 48.022 -48.022 45.487 38 48.146 -48.146 45.578 39 48.244 -48.244 45.651 40 48.347 -48.347 45.723 41 48.439 -48.439 45.782 44 48.164 -48.164 45.819 45 48.053 -48.053 45.742 47 47.733 -47.733 45.708 48 47.931 -47.931 45.877
figure
plot(T1{:,2}, T1{:,4},'.-')
txtstr = compose('%3d',T1{:,1}); % First Column Cell Array Of Strings
text(T1{:,2}, T1{:,4},txtstr)
Make appropriate changes to get the desired result.
See the documentation on text and compose for help with them.
.
  2 Comments
Star Strider
Star Strider on 11 Aug 2022
My pleasure!
If my Answer helped you solve your problem, please Accept it!
.

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!