Coastlines not showing or incomplete with geoshow
이전 댓글 표시
I am plotting geopotential height data with geoshow and would like to have coastlines superimposed on my data. In the code below, data is a 41x25 matrix. The shape of the matrix is always the same, but the values change with different levels of geopotential height. For my first level, the code below works as desired (first attached image). However, when I change the levels, the coast lines appear incomplete (second image) or not at all (third image). I do not change the code that produces the image, only the values in data change, as reflected by the scale on the colourbar. Any suggestions about where the problem is here would be greatly appreciated.
fig1= figure ('name', 'test');
worldmap(latMap, lonMap)
geoshow(latgrid, longrid, data, 'DisplayType','surface')
coast = load('coast.mat');
geoshow(coast.lat, coast.long)
c = colorbar;
댓글 수: 1
Chin Hsien Cheng
2022년 7월 15일
I have the same problem using geoshow... appreciate if someone can answer
geoshow(coastlat,coastlon, 'Color', 'black')
답변 (1개)
Chin Hsien Cheng
2022년 7월 15일
1 개 추천
Okay, I have figured out a solution:
In brief, if the Displaytype of data (double) is plotted in "texturemap" rather than "surface", the "disappearing problem" can then be resolved.
For my case:
load coastlines
figure
axesm('eqacylin', 'maplonlimit', [0 360], 'frame', 'on');
geoshow(Lat180', Lon360', DATA(:,:,1)','DisplayType','texturemap'); %this is ok
geoshow(coastlat,coastlon, 'Color', 'black')
geoshow(Lat180', Lon360', DATA(:,:,1)','DisplayType','surface'); %this will partially cover the coastlines
카테고리
도움말 센터 및 File Exchange에서 Create Plots on Maps에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!