How do do a pcolorm of an array with NaNs?

4 views (last 30 days)
A LL
A LL on 13 Jan 2022
I exported a mask from a coarser resolution to a finer resolution grid.
The grid with finer resolution is a lon x lat grid of size 1440x121 covering my domain.
I want to do a pcolorm(lat,lon,Z) over the region covering this given mask.
Since the mask is from a coarser resolution, the lat, lon and Z over the mask are filled with NaN and I can't get pcolorm to work properly.
I have:
-latitude (updownLat) and longitude (updownLon) coordinates for my points of interest (mask);
-the corresponding pressure values at each point of interest (mslp1Arctic);
-1440x121 matrix for the latitude at each grid cell (latMat);
-1440x121 matrix for the longitude at each grid cell (lonMat);
-1440x121 matrix with pressure values at each grid cell (mslp1);
-1440x121 matrix with the latitude values only at the coordinates of the points of interest and NaN elsewhere (latMatMask);
-1440x121 matrix with the longitude values only at the coordinates of the points of interest and NaN elsewhere (lonMatMask);
-1440x121 matrix with the pressure values only at the coordinates of the points of interest and NaN elsewhere (mslp1Mask);
I wish to plot a pcolorm(latMatMask,lonMatMask,mslp1Mask) with all the mslp1 values in the region covered by the mask.
% Figure I want to do
figure(1);
hold on;
axesm('MapProjection','eqdazim','MapLatLimit',[60 90]);
axis off;
framem on;
gridm on;
mlabel on;
plabel on;
setm(gca,'MLabelParallel',0);
%plotm(updownLat,updownLon,'.'); %Domain where I want to do the pcolorm (mask)
%pcolorm(latMatMask,lonMatMask,mslp1Mask); %NOT WORKING
%colormap(parula);
%cb = colorbar;
geoshow('landareas.shp','FaceColor',"none",'LineWidth',1);
axis off;
set(gca,'Fontsize',15);
gcf;
I have attached an image for a better visualisation of what I wish to do (matlabQuestion.png).
Thank you! :)

Answers (0)

Categories

Find more on Geographic Plots in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by