%% 绘制地形高程和水深图,需提前下载m_map包
f_g = figure(1);
set(f_g, 'Position', [500,50, 850, 880]);
minlon =105; maxlon=130;
minlat =17; maxlat=43; % 要绘制的区域,以中国沿海示例
m_proj('Miller Cylindrical','lon',[minlon maxlon],'lat',[minlat maxlat]);
[CS,CH] = m_etopo2('contourf',[-200:30:0 0:10:600],'edgecolor','none'); % [-200:30:0 0:10:600]:想显示的海拔范围
colormap([m_colmap('blues',20); m_colmap('gland',60)]);
brighten(.3);
ax = m_contfbar(1.05,[.1 0.9],CS,CH);
title(ax,{'Level (m)',''},'FontWeight','bold','fontsize',10);
m_gshhs('ic2','color',[0.55 0.55 0.55]); % 绘制海岸线
m_gshhs('ir2','color',[0.47, 0.59, 0.83],'LineWidth',1.0); % 绘制主要河流
m_grid('box','fancy','ticklen',0.006,'linestyle','none','tickdir','in','FaceColor','none','linewidth',2,'fontweight','bold','fontsize',16);
m_ruler([.05 .35],.05,'tickdir','in','ticklength',[0.01,0.01],'FontWeight','bold','fontsize',10); %比例尺
m_northarrow(minlon+2.5,maxlat-2.5, 2.5); %指北针
% 保存
% fdata = [location,'Topographic mapping'];
% print(gcf,'-djpeg','-r1080',[fdata,'.jpg']);
用matlab绘制地形高程和水深图
于 2023-09-07 21:27:17 首次发布