contourcmap issues
Show older comments
Hi, I am having issues with contourcmap and I believe my version is 2010b.
Just to give you an idea of what my code looks like, here are a few lines before my contonurcmap command, since i am using contourfm, i cant use colorbar (and represent what I want it to) so i am using contourcmap, when I try the examples listed online, I get all kinds of errors
figure(y-1)
axesm('MapProjection','eqdcylin', 'MapLatLimit', latlim, 'MapLonLimit', lonlim, 'Frame', 'on');
load coast;
plotm(lat,long,'k')
contourfm( lata, lon, squeeze(monanom(y,:,:)),20,'linestyle', 'none')
I then tried:
contourcmap('jet', 10, 'Colorbar', 'on', ...
'Location', 'horizontal', ...
'TitleString', 'Contour Intervals in Meters');
I GOT THIS ERROR
Warning: The 'CDELTA' parameter is ignored with contour
objects.
> In contourcmap>validateContourParams at 282
In contourcmap at 95
In readsst at 34
I also tried, just in case,
contourcmap(10, 'jet', 'Colorbar', 'on', ...
'Location', 'horizontal', ...
'TitleString', 'Contour Intervals in Meters');
when I dont include, the '10, there is no issue but I also want to control the increment on my color bar and the amount of color levels, do you have any suggestions and can figure out the problem?
I also tried
contourcmap('jet',[0:5:50],...
'colorbar','on','location','horizontal')
straight off the website for help and got the error
Warning: The 'CDELTA' parameter is ignored with contour
objects.
Answers (1)
Walter Roberson
on 3 Oct 2011
The documentation does specifically say,
contourcmap(cmapstr,cdelta) updates the figure's colormap with colors varying according to cdelta. If the axes contains Mapping Toolbox contour objects, the value of cdelta is ignored.
Your axes do, however, contain Mapping Toolbox contour objects.
If I read your code and the documentation correctly, you appear to have asked for 20 total contour levels to be generated, spread out evenly over the range of the data, but you are hoping to generate a colormap which is in fixed increments of 10 meters. I do not think I see the point, since the fixed 10 meters could cover anywhere from a fraction of a contour interval to several contour intervals, depending on the data being mapped.
Would you not prefer to specify explicit contour levels in your contourfm call?
Categories
Find more on Geographic Plots in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!