2012-08-24 630 views
2

我在MATLAB中绘制了一个在Mercator(平面)世界地图上的轮廓图。在MATLAB中使用Geoshow的颜色映射图

而且我成功了,但是当我使用

geoshow('landareas.shp','FaceColor', [0.5 1.0 0,5]) 

它消除了地图上的等高线图。

我的代码是:

axesm('mercator','MapLatLimit',[-50 90],'MapLonLimit',[0 250]) 

frame on; 

grid on; 

plotm(lat,long,'k') 

contourfm(x,y,z) 

反正是有应用

geoshow('landareas.shp','Display',[0.5 1.0 0.5]) 

回答

2

我不知道你想实现的,所以如果我的回答将是一个错误的方向正是我们可以详细阐述。

我用这个代码产生地图contourfm'landareas'

load geoid; 
figure(1) 
axesm ('mercator','MapLatLimit',[-50 90],'MapLonLimit',[0 250]) 
contourfm(geoid,geoidrefvec, 'LineStyle', 'none'); 
geoshow('landareas.shp', 'FaceColor', [0.5 1.0 0.3]); 

enter image description here

相反的geoid你可以有自己的地图,但上的网格点的数量注意。据我所知他们必须是180x360。

一注意。你可以考虑使用coast而不是landareas,因为contourfm产生所有的彩色地图和'landareas'也有颜色。所以,如果它适合你,你可以把只海岸线替代:

load geoid; 
figure(2) 
axesm ('mercator','MapLatLimit',[-50 90],'MapLonLimit',[0 250]) 
contourfm(geoid,geoidrefvec, 'LineStyle', 'none'); 
load coast 
plotm(lat, long,'black') % plot the coast on the map 

contourfm with coast

+0

MasterPJ - 非常感谢。我一直需要一个答案。我几乎放弃了。 – user1608954

+0

请帮我看看这个查询:http://stackoverflow.com/questions/39155845/attaching-customized-colormap-to-geoshow-in-matlab – Munish