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 Comment

I have the same problem using geoshow... appreciate if someone can answer
geoshow(coastlat,coastlon, 'Color', 'black')

Sign in to comment.

Answers (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

Products

Release

R2017b

Asked:

on 14 Oct 2018

Answered:

on 15 Jul 2022

Community Treasure Hunt

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

Start Hunting!