colorbar scale not reflected on contour map
Show older comments
Hello all,
I have been reading on setting a single colorbar scale to multiple maps, but I am not finding the results that I am looking for.
I have multiple maps and I would like to set the same color scale for them from 0-25. I have tried the examples on the forum, but the contour map colors are not reflecting the color scale.
For example, I have a contour map with Maximum value of 12, which should be a green color based on the 0-25 color scale, but it shows up yellow, which corresponds to the maximum value of the color scale, 25. Is there a way to force the scale onto all my maps so that they reflect the 0-25 scale on the contourmap?
My code is below:
figure('Color','white')
latlim = [-90 90];
lonlim = [ 0 360];
gratsize = 1 + [diff(latlim), diff(wrapTo360(lonlim))]/6;
[lat, lon] = meshgrat(latlim, lonlim, gratsize);
ax=worldmap ('world')
setm(ax,'mlabelparallel',-90)
contourfm(latlim,lonlim,Final')
coast = load('coast');
geoshow(coast.lat, coast.long,'Color', 'white')
caxis manual;
caxis([0 20]);
colorbar;
Thank you for your time and input.
Answers (1)
Walter Roberson
on 12 Jul 2016
Your
caxis([0 20]);
is a problem if you want the maximum to reflect 25.
Categories
Find more on Colorbar 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!