colorbar scale not reflected on contour map

2 ビュー (過去 30 日間)
Vesp
Vesp 2016 年 7 月 11 日
回答済み: Walter Roberson 2016 年 7 月 12 日
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.

回答 (1 件)

Walter Roberson
Walter Roberson 2016 年 7 月 12 日
Your
caxis([0 20]);
is a problem if you want the maximum to reflect 25.

Community Treasure Hunt

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

Start Hunting!

Translated by