【MATLAB】pcolor与等深线画图问题

clear
close all

m_proj('Equidistant Cylindrical','long',[115,118],'lat',[20,22])
m_coast('patch',[0.6,0.6,0.6],'linewidth',1,'edgecolor','k');
set(gca,'fontsize',14)
m_grid('xlim',[115,118],'ylim',[20,23],...
    'linewidth',1,'tickdir','in','box','fancy',...
    'fontsize',14,'fontweight','bold');
hold on


data = xlsread('1.xlsx');
lon = data(:,2);
lat = data(:,3);
ampt = data(:,8);
ampy = data(:,9);
[x,y] = m_ll2xy(lon,lat);
scatter(x,y,80,'filled','cdata',ampy);colormap(jet);colorbar;
xlabel('经度')
ylabel('纬度')
set(gca,'fontsize',14)

hold on
[depth,geo] = geotiffread('Depth.tif');
depth = double(depth);
lat1 = geo.LatitudeLimits(1);
lat2 = geo.LatitudeLimits(2);
lon1 = geo.LongitudeLimits(1);
lon2 = geo.LongitudeLimits(2);
[m, n] = size(depth);
lat_depth = linspace(lat2,lat1,m);
lon_depth = linspace(lon1,lon2,n);
clear lon1 lon2 lat1 lat2
[lon_depth, lat_depth] = meshgrid(lon_depth, lat_depth');
[x2, y2]=m_ll2xy(lon_depth, lat_depth);
hold on
depth_level = [ -200, -500,-1000];
[C,h]=contour(x2,y2,depth, depth_level,'color',[0.5, 0.5, 0.5],'linewidth',1);
clabel(C,h)
set(gca, 'Clim', [20,110])

  • 4
    点赞
  • 18
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值