Slice Displaying Grids Instead of Color
Just like the title said, I have a problem with displaying the correct slice. I attach the said generated figure below. Also this is my test script:
tas = ncread("datadary_ATM.2023030100.nc", "ta");
lat = ncread("datadary_ATM.2023030100.nc", "lat");
lon = ncread("datadary_ATM.2023030100.nc", "lon");
kz = ncread("datadary_ATM.2023030100.nc", "kz");
time = ncread("datadary_ATM.2023030100.nc", "time");
ta = ncread("datadary_ATM.2023030100.nc", "ta"); ta = ta – 273.15;
ua = ncread("datadary_ATM.2023030100.nc", "ua"); ua = ua(:, :, 1, 4);
va = ncread("datadary_ATM.2023030100.nc", "va"); va = va(:, :, 1, 4);
wa = ncread("datadary_ATM.2023030100.nc", "wa"); wa = wa(:, :, 1, 4);
[longrid, latgrid] = meshgrid(lon, lat);
kzlevel = 18;
kz2d = kz(kzlevel) * ones(size(longrid));
[x,y,z] = meshgrid(lon, lat, kz);
ta = squeeze(ta(:,:,:,1));
figure;
slice(x,y,z,ta,[],[],1:4);
colormap("turbo");
colorbar;
clim([0 50]);
axis xy;Just like the title said, I have a problem with displaying the correct slice. I attach the said generated figure below. Also this is my test script:
tas = ncread("datadary_ATM.2023030100.nc", "ta");
lat = ncread("datadary_ATM.2023030100.nc", "lat");
lon = ncread("datadary_ATM.2023030100.nc", "lon");
kz = ncread("datadary_ATM.2023030100.nc", "kz");
time = ncread("datadary_ATM.2023030100.nc", "time");
ta = ncread("datadary_ATM.2023030100.nc", "ta"); ta = ta – 273.15;
ua = ncread("datadary_ATM.2023030100.nc", "ua"); ua = ua(:, :, 1, 4);
va = ncread("datadary_ATM.2023030100.nc", "va"); va = va(:, :, 1, 4);
wa = ncread("datadary_ATM.2023030100.nc", "wa"); wa = wa(:, :, 1, 4);
[longrid, latgrid] = meshgrid(lon, lat);
kzlevel = 18;
kz2d = kz(kzlevel) * ones(size(longrid));
[x,y,z] = meshgrid(lon, lat, kz);
ta = squeeze(ta(:,:,:,1));
figure;
slice(x,y,z,ta,[],[],1:4);
colormap("turbo");
colorbar;
clim([0 50]);
axis xy; Just like the title said, I have a problem with displaying the correct slice. I attach the said generated figure below. Also this is my test script:
tas = ncread("datadary_ATM.2023030100.nc", "ta");
lat = ncread("datadary_ATM.2023030100.nc", "lat");
lon = ncread("datadary_ATM.2023030100.nc", "lon");
kz = ncread("datadary_ATM.2023030100.nc", "kz");
time = ncread("datadary_ATM.2023030100.nc", "time");
ta = ncread("datadary_ATM.2023030100.nc", "ta"); ta = ta – 273.15;
ua = ncread("datadary_ATM.2023030100.nc", "ua"); ua = ua(:, :, 1, 4);
va = ncread("datadary_ATM.2023030100.nc", "va"); va = va(:, :, 1, 4);
wa = ncread("datadary_ATM.2023030100.nc", "wa"); wa = wa(:, :, 1, 4);
[longrid, latgrid] = meshgrid(lon, lat);
kzlevel = 18;
kz2d = kz(kzlevel) * ones(size(longrid));
[x,y,z] = meshgrid(lon, lat, kz);
ta = squeeze(ta(:,:,:,1));
figure;
slice(x,y,z,ta,[],[],1:4);
colormap("turbo");
colorbar;
clim([0 50]);
axis xy; 4d, visualization, slice MATLAB Answers — New Questions