[matlab]南海地形眩晕图代码

[matlab]南海地形眩晕图代码

请ChatGPT帮写个南海地形眩晕图代码

图片

图片

代码

复制代码
.rtcContent { padding: 30px; } .lineNode {font-size: 12pt; font-family: "Times New Roman", Menlo, Monaco, Consolas, "Courier New", monospace; font-style: normal; font-weight: normal; }
clc;clear;close all
% 读取数据
file='F:\data\etopo\etopo1.nc';
lon=double(ncread(file,'x'));
lat=double(ncread( file,'y'));
h=double(ncread(file,'z'));
% 选定区域南海
area  =[108 125 12 26];
ln =find(lon>=area(1)&lon<=area(2));
la=find(lat>=area(3)&lat<=area(4));
lon = lon(ln);lat  = lat(la);H = h(ln,la);
%% %%m_pcolor画出了区域的等深线图
close all
figure;
set(0,'defaultfigurecolor','w')
set(gcf,'position',[50 50 1300 900])
subplot(121,'position',[0.1 0.065 0.45 0.7])
m_proj('Miller', 'long', [108 125], 'lat', [12 26]);
cmap=flip(colormore_65([50]));
caxis([-5000 0])% 这些必须放在m_shaderelief的前面,不然不可用
% 通过经纬度坐标的高程数据,生成X/Y坐标的高程数据
[IM,X,Y]=m_image(lon,lat,H');
% 将X/Y坐标的高程数据画图,注意设置coords参数为map
m_shadedrelief(X,Y,IM,cmap,'coords','map');
m_gshhs_f('patch',[0.8 0.8 0.8]);
xticks = 108:2:126;
yticks = 12:2:26;
m_grid('tickdir', 'out', 'gridlines', 'no', 'fontsize', 14, 'linewidth', 2, ...
    'xtick', xticks, 'ytick', yticks);
ax = gca;
ax.LineWidth = 2;
hold on
m_scatter(115,19,'^','sizedata',80,'markerfacecolor','r')
m_text(115-0.2,19-0.4,  'Buoy Site','color','r','fontsize',15);
m_text(108.2,25.55,'(a)', 'FontSize', 18,'Fontweight','bold');
%5 little picture
subplot(122,'position',[0.54 0.12 0.45 0.6])
clc;clear;
% 读取数据
file='F:\data\etopo\etopo1.nc';
lon=double(ncread(file,'x'));
lat=double(ncread( file,'y'));
h=double(ncread(file,'z'));
% 选定区域南海
area  =[112 1118 16 23];
ln =find(lon>=area(1)&lon<=area(2));
la=find(lat>=area(3)&lat<=area(4));
lon = lon(ln);lat  = lat(la);H = h(ln,la);
% 坐标的meshgrid
[x,y]=meshgrid(lon,lat);
x=x'; y=y';
%% %%m_pcolor画出了区域的等深线图
m_proj('Miller', 'long', [112 118], 'lat', [ 16 22]);
cmap=flip(colormore_65([50]));
caxis([-5000 0])% 这些必须放在m_shaderelief的前面,不然不可用
% 通过经纬度坐标的高程数据,生成X/Y坐标的高程数据
[IM,X,Y]=m_image(lon,lat,H');
% 将X/Y坐标的高程数据画图,注意设置coords参数为map
m_shadedrelief(X,Y,IM,cmap,'coords','map');
m_gshhs_f('patch',[0.8 0.8 0.8]);
xticks = 108:1:126;
yticks = 12:1:26;
m_grid('tickdir', 'out', 'gridlines', 'no', 'fontsize', 14, 'linewidth', 2, ...
    'xtick', xticks, 'ytick', yticks);
ax = gca;
ax.LineWidth = 2;
hold on
m_scatter(115,19,'^','sizedata',80,'markerfacecolor','r')
m_text(115-0.2,19-0.4,  'Buoy Site','color','r','fontsize',15);
m_text(112.13,21.85,'(b)', 'FontSize', 18,'Fontweight','bold');
set(gca, 'DataAspectRatio', [1 0.9 1]); % 设置坐标轴的长宽比
% 添加一个全局 colorbar
hcb = colorbar('southoutside'); % 将 colorbar 放在下面
set(hcb, 'Position', [0.12 0.04 0.8 0.03],'fontsize',10,'fontweight','bold'); % 手动调整 colorbar 位置
export_fig('scs_shadinginterp.jpg','-r700')
相关推荐
tobebetter952723 分钟前
How to manage python versions on windows
开发语言·windows·python
9***P3341 小时前
PHP代码覆盖率
开发语言·php·代码覆盖率
CoderYanger1 小时前
优选算法-栈:67.基本计算器Ⅱ
java·开发语言·算法·leetcode·职场和发展·1024程序员节
jllllyuz2 小时前
Matlab实现基于Matrix Pencil算法实现声源信号角度和时间估计
开发语言·算法·matlab
多多*2 小时前
Java复习 操作系统原理 计算机网络相关 2025年11月23日
java·开发语言·网络·算法·spring·microsoft·maven
p***43482 小时前
Rust网络编程模型
开发语言·网络·rust
ᐇ9592 小时前
Java集合框架深度实战:构建智能教育管理与娱乐系统
java·开发语言·娱乐
梁正雄3 小时前
1、python基础语法
开发语言·python
强化学习与机器人控制仿真3 小时前
RSL-RL:开源人形机器人强化学习控制研究库
开发语言·人工智能·stm32·神经网络·机器人·强化学习·模仿学习
百***48073 小时前
【Golang】slice切片
开发语言·算法·golang