How to force the colorbar to adopt n values?
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Daniëlle Nijhof
am 21 Nov. 2017
Kommentiert: Daniëlle Nijhof
am 22 Nov. 2017
Hi everyone,
I've made a 3x3 subplot using pcolor. The colorbars of the left and right columns of the plot adopt three values, i.e. 60, 65 and 70. I would like the colorbars of the center column to adopt three values as well, i.e. 62, 67 and 72, instead of six values as it is now.
Can someone help me out?

2 Kommentare
Akzeptierte Antwort
KL
am 21 Nov. 2017
Bearbeitet: Walter Roberson
am 21 Nov. 2017
Always use a handle,
When you create a colorbar, do it like,
c{1,1} = colorbar;
c{1,1}.Ticks = [60 65 70];
do it for all 9 subplots and you can control your colorbars just by accessing its index.
Weitere Antworten (1)
Image Analyst
am 21 Nov. 2017
Try this:
colormap(jet(256)) % Use 256 colors.
caxis([62, 72]);
c = colorbar % Get handle to colorbar
c.Ticks = [62,67,72] % Set tick values.
Siehe auch
Kategorien
Mehr zu Animation 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!
