[英]Plot points on map in matlab
我試圖在MATLAB中使用在MATLAB的地圖上繪制點來在matlab的地圖上繪制點,但是由於某些原因,該點不會出現。 這是我的代碼。
figure('visible','on');
%%% Set the map boundaries
hi_lat=43.86;
lo_lat=41.23;
hi_lon= 6.08;
lo_lon=2.21;
%%% Plot
worldmap ([lo_lat hi_lat], [lo_lon hi_lon]) % lat and lon bounds of your plot
geoshow('landareas.shp','FaceColor', 'green', 'EdgeColor', [0 0 0])
geoshow('worldcities.shp', 'Marker', '.',...
'Color', 'red')
labelLat = 43.5;
labelLon = 5.35;
textm(labelLat, labelLon, 'Marseille')
framem off; gridm off; mlabel off; plabel off
lat=3.13;
lon=42.48;
geoshow(lat,lon, 'DisplayType', 'Point', 'Marker', '+', 'Color', 'red'); %Part of the code that's not doing what I want it to do.
hold on
我該如何繪制另一點? 為什么它不會出現?
您在地圖上標記的點不會出現,因為您已經超過了緯度和經度限制。 嘗試這個;
lat=42.48;
lon=3.13;
現在工作! 結果如下:
您代碼中的錯誤在這里:
lat=3.13;
lon=42.48;
您剛剛混合了緯度和經度,因此其試圖在地圖上繪制一些較遠的點。
嘗試:
lat=42.48;
lon=3.13;
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.