matlab m_map学习总结系列7

有个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);

在这里插入图片描述

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

早起CaiCai

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值