Plot numbers in geoplot

조회 수: 5 (최근 30일)
Dion Theunissen
Dion Theunissen 2021년 11월 8일
답변: Adam Danz 2021년 11월 8일
I have the following code, but this wil not work:
for g = 1:size(scaniadatacompare3)
latStart = scaniadatacompare3.StartLatitude(g);
lonStart = scaniadatacompare3.StartLongitude(g);
latStop = scaniadatacompare3.EndLatitude(g);
lonStop = scaniadatacompare3.EndLongitude(g);
geoplot([latStart latStop],[lonStart lonStop],'b-*','LineWidth',3)
geobasemap streets
hold on
textm(latStart, lonStart+0.3, num2str((scaniadatacompare3.DistanceKm(g))'), 'FontSize',14)
hold on
end
Here I read a table with latitude and longitude coordinates. In this table is also a DistanceKm number, I need to plot this number over the map as a layer. Anyone who can help me with this?

답변 (1개)

Adam Danz
Adam Danz 2021년 11월 8일
Specifying the coordinates in geoplots can be tricky since. Don't forget that South and West are negative values. See this demo from the documentation.
It may be helpful to use
xy = ginput(1)
to manually select the location of the text and see the coordinates.

카테고리

Help CenterFile Exchange에서 Geographic Plots에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by