有个m_lldist很纠结
%投影
m_coast('patch',[.7 1 .7],'edgecolor','none');
%大陆,无岸线
m_grid('box','fancy','linestyle','-','gridcolor','w','backcolor',[.2 .65 1]);
%外框
cities={'Cairo','Washington','Buenos Aires'};
%字符串赋值
lons=[ 30+2/60 -77-2/60 -58-22/60];
lats=[ 31+21/60 38+53/60 -34-45/60];
%3个cities的坐标
for k=1:3
[range,ln,lt]=m_lldist([-123-6/60 lons(k)],[49+13/60 lats(k)],40);
%-123-6/60,49+13/60;ln有41个数;lt有41个;插值
%m_lldist函数没用过;m_line是直线;加了后变成曲线
%查了,是计算2点之间的距离;ranges是2点之间的距离;红色里程线
m_line(ln,lt,'color','r','linewi',2);
%2-2之间连线
m_text(ln(end),lt(end),sprintf('%s - %d km',cities{k},round(range)));
%m_text也很有意思;前面是城市;后面是range取整;
end
title('Great Circle Routes','fontsize',14,'fontweight','bold');
%标题
set(gcf,'color','w'); % Need to do this otherwise 'print' turns the lakes black
%背景色变白
% This projection shows all the oceans connected to each other - the outside ring
% is the Asian coastline (Thanks to M B-O for this idea)
% otherwise its just an example of different map types.
m_proj('azimuthal equal-area','radius',156,'lat',-46,'long',-95,'rot',30);
%投影
ax1=subplot(2,2,1,'align');
m_coast('patch','r');
%大陆颜色red
m_grid('xticklabel',[],'yticklabel',[],'linestyle','-','ytick',[-60:30:60]);
ax2=subplot(2,2,2,'align');
m_elev('contourf',[-7000:1000:0 500:500:3000],'edgecolor','none');
%高程;这里是1度的数据精度m_elev
colormap(ax2,[m_colmap('blues',70);m_colmap('gland',30)]);
%地图的颜色
caxis(ax2,[-7000 3000]);
m_grid('xticklabel',[],'yticklabel',[],'linestyle','-','ytick',[-60:30:60]);
ax3=subplot(2,2,3,'align');
colormap(ax3,[m_colmap('blues',70);m_colmap('gland',30)]);
caxis(ax3,[-7000 3000]);
m_elev('image');
%m_elev的另一种用法;颜色不一样;与上面相比
m_grid('xticklabel',[],'yticklabel',[],'linestyle','-','ytick',[-60:30:60]);
ax4=subplot(2,2,4,'align');
colormap(ax4,[m_colmap('blues')]);
caxis(ax4,[-8000 000]);
%主要显示的海洋的colormap
m_elev('shadedrelief','gradient',.5);
m_coast('patch',[.7 .7 .7],'edgecolor','none');
m_grid('xticklabel',[],'yticklabel',[],'linestyle','-','ytick',[-60:30:60]);
ha = axes('Position',[0 0 1 1],'Xlim',[0 1],'Ylim',[0 1],'Box','off',...
'Visible','off','Units','normalized', 'clipping' , 'off');
text(0.5, 0.98,'This projection shows all oceans connected to each other',...
'horiz','center','fontsize',20);