Multiple errors while using contourfm

I have 2 different variables (indmap19 and indmap20) that I would like to contour in a map. There is no problem when I contour indmap19, but I get multiple errors when I try to contour indmap20. This is very strange because ...
indmap20 = 1 - indmap19;
Here is the code that successfully maps indmap19 (but not indmap20). Both variables are 349 x 277 matrices with numbers varying from 0-1. The latitude (nlat) and longitude (nlon) are from a netcdf data file imported much earlier in the code:
1 figure; ax = usamap({'AZ','CO'});
2 set(ax, 'Visible', 'off')
3 latlim = getm(ax, 'MapLatLimit');
4 lonlim = getm(ax, 'MapLonLimit');
5 states = shaperead('usastatehi',...
'UseGeoCoords', true, 'BoundingBox', [lonlim', latlim']);
6 hold on
7 contourfm(nlat,nlon,indmap19)
8 geoshow(ax, states,'FaceColor','none')
9 title('% season VPD > mean VPD + 1 sigma, 1979-1999')
10 colorbar
11 caxis([0 1])
Here is the (long) list of errors I get when I substitute indmap20 for indmap19 in line 7:
Error using map/private/adjustContourTopology>cornersTraversed
Too many input arguments.
Error in adjustContourTopology>traceSector (line 401)
corners = cornersTraversed(endPosition, E(p).Position);
Error in adjustContourTopology>traceAllSectors (line 346)
[xs, ys, B, tracedForward, tracedBackward] = traceSector(numSectors, ...
Error in adjustContourTopology>analyzeTopology (line 148)
[S, B] = traceAllSectors(x, y, xlimit, ylimit, xmax, ymax);
Error in adjustContourTopology (line 86)
[C, B, S] = analyzeTopology(x, y, xlimit, ylimit, xmax, ymax);
Error in contourIntrinsic>fixTopology (line 365)
[x, y, xp, yp] = adjustContourTopology( ...
Error in contourIntrinsic (line 122)
[L, P] = fixTopology(L, xLimit, yLimit, xmax, ymax);
Error in geocontours (line 138)
[L, P] = contourIntrinsic(Z, levels, R.RasterInterpretation, edgefix);
Error in internal.mapgraph.GeographicContourGroup/getFillPolygons (line 100)
[h.pContourLines, h.pFillPolygons] ...
Error in internal.mapgraph.ContourGroup/refresh (line 434)
S = h.getFillPolygons();
Error in contourm (line 116)
refresh(h)
Error in contourfm (line 36)
contourm(varargin{:},'Fill','on','DefaultLineColor','black');
Thanks so much for your help!

5 commentaires

Chad Greene
Chad Greene le 9 Juil 2015
Can you upload your data so we can try to replicate the problem?
Kimberly
Kimberly le 10 Juil 2015
Hi Chad,
I've attached 4 files with the relevant data. Please let me know if it works for you.
Thanks so much for your help,
Kimberly
Walter Roberson
Walter Roberson le 11 Juil 2015
The files did not get attached.
Kimberly
Kimberly le 13 Juil 2015
Can you let me know if they're attached now?
Zhao-Yang CHAI
Zhao-Yang CHAI le 28 Juin 2018
Could you tell me what's the size of indmap19? Is it 'nlat x nlon'?

Connectez-vous pour commenter.

Réponses (1)

Chad Greene
Chad Greene le 16 Juil 2015
Strange. I get the same behavior. I will point out that
isequaln(indmap20,1 - indmap19)
ans =
0
meaning indmap20 is not equal to 1-indmap19. That's evident in the number of NaNs in each matrix. But that's not the cause of the problem. I'm not sure what is. Do you need to use contourfm? I generally avoid it because it's so slow and ugly. Will pcolorm suffice?

Catégories

En savoir plus sur Geographic Plots dans Centre d'aide et File Exchange

Question posée :

le 9 Juil 2015

Commenté :

le 28 Juin 2018

Community Treasure Hunt

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

Start Hunting!

Translated by