How to mark labels on sampling points

2 ビュー (過去 30 日間)
Udaya
Udaya 2022 年 8 月 8 日
コメント済み: Star Strider 2022 年 8 月 11 日
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

回答 (1 件)

Star Strider
Star Strider 2022 年 8 月 8 日
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 件のコメント
Udaya
Udaya 2022 年 8 月 11 日
That's what I exactly want. Thank you very much
Star Strider
Star Strider 2022 年 8 月 11 日
My pleasure!
If my Answer helped you solve your problem, please Accept it!
.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeLighting, Transparency, and Shading についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by