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])
【MATLAB】pcolor与等深线画图问题
最新推荐文章于 2023-06-01 17:25:06 发布