使用imagesc和固定轴进行映射

时间:2019-06-16 11:27:48

标签: matlab

bathymetry image2 Bathymetry image嗨,我正在尝试更改测深仪的分辨率(2041x1441)以适合叶绿素(960x348)。我设法在matlab中使用griddata做到了这一点,但是现在当我使用imagesc绘制图形时,地图的绘制方向朝上。难道我做错了什么?

下面是我尝试过的脚本。

clear all; close all;

fn='SA_OCCCI_Monthly_199801.nc';
chl_lat = ncread(fn, 'lat');
chl_lon = ncread(fn, 'lon');
chl_chla = ncread(fn, 'chlor_a');

chl_chl_a = fliplr(chl_chla);

[chl_lat2d,chl_lon2d] = meshgrid(chl_lat,chl_lon);

chl_lon_min = min(chl_lon2d(:));
chl_lon_max = max(chl_lon2d(:));
chl_lat_min = min(chl_lat2d(:));
chl_lat_max = max(chl_lat2d(:));

fn2='GEBCO_2019_20.0_-32.0_30.0_-38.0.nc';
bath_lon = ncread(fn2, 'lon'); bath_lon=fliplr(bath_lon);
bath_lat = ncread(fn2, 'lat'); bath_lat=fliplr(bath_lat);
bath_depth_orig= ncread(fn2,'elevation'); 
bath_depth=permute(bath_depth_orig,[2,1]);
bath_depth=flipud(bath_depth);

gridded_bath = griddata(bath_lon,bath_lat,bath_depth,chl_lon2d, 
chl_lat2d);
gridded_bath = flipud(gridded_bath);


shelf_bath=gridded_bath;
shelf_bath(gridded_bath>0 | gridded_bath<-200)=NaN;
shelf_bath = fliplr(shelf_bath);


figure;
subplot(2,2,1); imagesc(bath_lon,bath_lat,bath_depth'); colorbar;
subplot(2,2,2); imagesc(chl_lon,chl_lat,shelf_bath'); colorbar;
subplot(2,2,3); imagesc(chl_lon,chl_lat,chl_chl_a'); colorbar;
subplot(2,2,4); imagesc(chl_lon,chl_lat,gridded_bath'); colorbar;

我最后得到的图像在右侧有两个地图。

0 个答案:

没有答案