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 comentario

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

Iniciar sesión para comentar.

Respuestas (1)

Chin Hsien Cheng
Chin Hsien Cheng el 15 de Jul. de 2022
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

Productos

Versión

R2017b

Etiquetas

Preguntada:

el 14 de Oct. de 2018

Respondida:

el 15 de Jul. de 2022

Community Treasure Hunt

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

Start Hunting!

Translated by