【matlab】matlab给海图等值线加单位

【matlab】matlab给海图等值线加单位

本文思路来源于:

MATLAB | 那些你不得不知道的MATLAB小技巧(五) 字符串及符号运算专题 (qq.com)

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

clear;clc;close all
%% 微信公众号:海洋与大气科学
%% 时间:2023年12月27号
%% 1:读取数据:波高数据;
datahs=load(‘hs.mat’);
hs=datahs.hs_new;
clear datahs
hs=hs-0.6;
[x,y]=meshgrid(linspace(117,127,81),linspace(33,41,65));
%% 2:画图 %% 等值线分布情况%% 加上地图
close all;
figure
set(gcf,‘position’,[50 50 1000 800],‘color’,‘w’)
m_proj(‘lambert’,‘lat’,[33 41],‘long’,[117 127]);
[c,co_h]=m_contour(x,y,hs,[-0.1,0,0.2,0.4,0.5],‘color’,‘k’,‘ShowText’,‘on’,‘LabelFormat’,@mylabelfun);%
set(co_h,‘linestyle’,‘-’,‘LineWidth’,2);
clabel(c,co_h,‘FontSize’,13,‘Color’,‘k’,‘fontname’,‘time news roman’);
title(‘中国黄渤海区域平均波高图’,‘fontsize’,12,‘fontname’,‘宋体’);
m_gshhs_f(‘patch’,[.8 .8 .8]);
m_grid(‘box’,‘fancy’);
export_fig(‘中国黄渤海区域平均波高图.png’,‘-r300’)
%
close all;
figure
set(gcf,‘position’,[50 50 1000 800],‘color’,‘w’)
m_proj(‘lambert’,‘lat’,[33 41],‘long’,[117 127]);
[c,co_h]=m_contour(x,y,hs,[-0.1,0,0.2,0.4,0.5],‘color’,‘k’,‘ShowText’,‘on’,‘LabelFormat’,@mylabelfun);%
set(co_h,‘linestyle’,‘-’,‘LineWidth’,2);
clabel(c,co_h,‘FontSize’,13,‘Color’,‘r’,‘fontname’,‘time news roman’);
title(‘中国黄渤海区域平均波高图’,‘fontsize’,12,‘fontname’,‘宋体’);
m_gshhs_f(‘patch’,[.8 .8 .8]);
m_grid(‘box’,‘fancy’);
export_fig(‘中国黄渤海区域平均波高图1.png’,‘-r300’)
%
close all;
figure
set(gcf,‘position’,[50 50 1000 800],‘color’,‘w’)
m_proj(‘lambert’,‘lat’,[33 41],‘long’,[117 127]);
[c,co_h]=m_contour(x,y,hs,[-0.1,0,0.2,0.5],‘color’,‘k’,‘ShowText’,‘on’,‘LabelFormat’,@mylabelfun);%
set(co_h,‘linestyle’,‘-’,‘LineWidth’,1);
clabel(c,co_h,‘FontSize’,13,‘Color’,‘k’,‘fontname’,‘time news roman’);
%
hold on
[c,co_h]=m_contour(x,y,hs,[0.4 0.4],‘color’,‘k’,‘ShowText’,‘on’,‘LabelFormat’,@mylabelfun);%
set(co_h,‘linestyle’,‘-’,‘LineWidth’,2);
clabel(c,co_h,‘FontSize’,14,‘Color’,‘r’,‘fontname’,‘time news roman’);
title(‘中国黄渤海区域平均波高图’,‘fontsize’,12,‘fontname’,‘宋体’);
m_gshhs_f(‘patch’,[.8 .8 .8]);
m_grid(‘box’,‘fancy’);
export_fig(‘中国黄渤海区域平均波高图2.png’,‘-r300’)

  • 24
    点赞
  • 22
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

海洋与大气科学

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

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

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

打赏作者

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

抵扣说明:

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

余额充值