Problems with m_proj for specific area of the world
14 views (last 30 days)
I have recently switched from python and R to Matlab to use certain features that Matlab offers and Python doesn't. I have been looking at a lot of tutorials and info on my specific problem but cannot solve it.
I basically have Mean Sea Level Pressure data in a NetCDF file stored as lon lat and my data. I need to plot my data over and around Antarctica and also add coastlines using the m_map package but I keep getting error messages such as:
>> Output argument "ncst" (and maybe others) not assigned during call to
>> Error in m_coast (line 28)
Undefined function 'checkellipsoid' for input arguments of type 'double'.
>> Error in resetmstruct (line 29)
checkellipsoid(mstruct.geoid, 'resetmstruct', 'mstruct.geoid');
>> Error in axesm (line 139)
mstruct = resetmstruct(mstruct);
My code at the moment (which plots my data correctly but for the whole word) is as follows:
% Create overal world view of MSLP data
nc = netcdf.open('MSLP_lagged_15.nc','NC_NOWRITE');
high_15 = netcdf.getVar(nc,15,[0 0],[480 241],'double'); %(file, var number, Dim start, Dim end
lon = netcdf.getVar(nc,0,0,480) % (File, VarID, Start = 0 , End = 480)
lat = netcdf.getVar(nc,1,0,241) % (File, VarID, Start = 0 , End = 241)
for p = 1:480
for q = 1:241
if abs(high_15(p,q)) > 99 % get rid of 99 values if any and replace by NaN
high_15(p,q) = nan;
map(q,p) = high_15(p,q);
%set(get(h,'title'),'string','ENSO MSLP Correlation');
When I try to add:
to get a focus on Antarctica, my data disappears completely and leaves me with a half white and half green figure of Antarctica's coastline but my data has disappeared completely. Is it an problem of ordering my code so that m_proj comes first before my data? And any idea why I always have error messages when I try to use packages such as m_coast? My Matlab version is MATLAB R2012b x64 and I have already reset my path just in case using:
Any help on this would be useful.
Chad Greene on 7 Jul 2017
Can you do it with Antarctic Mapping Tools? Syntax would be
I'm not sure how your lat,lon data are formatted, but you might need to do
[Lon,Lat] = meshgrid(lon,lat);
[Lat,Lon] = meshgrid(lat,lon);
before calling pcolorps.