creating deciles in a colorbar/colormap

1 Ansicht (letzte 30 Tage)
Ger
Ger am 11 Jul. 2011
Hi,
I'm trying to create deciles in my colourbar. I have rainfall anomalies for 306 stations over 149 years (1863-2011) and for every month of the 149 years (12 months per year).
So far I have only figured out how to give my colorbar a set minimum and maximum value. I would prefer to be able to set my colorbar to have deciles going out in steps of 20% from the 0 value. Hence i would have 10 deciles [>80%, 80 to 60%, 60 to 40%, 40 to 20%, 20 to 0%, 0 to -20%, -20 to -40%, -40 to -60%, - 60 to -80%, <-80%]
thanks for any help anyone can provide...
ZI = griddata(x,y,z,XI,YI);
% plot the results
pcolor(xi,yi,ZI)
xlabel('Longitude (^o)')
ylabel('Latitude (^o)')
title('Mapped Rainfall Anomaly (mm/month) for January 1997')
colormap
caxis([-1000 1000])
colorbar

Akzeptierte Antwort

Patrick Kalita
Patrick Kalita am 11 Jul. 2011
You should be able to do that by setting a colormap with only 10 values. For example, using the jet colormap:
pcolor(peaks);
colormap(jet(10))
colorbar
caxis([-10 10])
For a list of other colormaps you can use see this documentation page. Any of them will accept a numeric input argument to specify the number of colors.

Weitere Antworten (0)

Kategorien

Mehr zu Counter and Timer Input and Output finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by