I tried to set a colorbar according to the following way:
m1 = [101 255 255]./255;m2 = [207 170 85]./255;m3 = [255 207 0]./255;m4= [255 255 101]./255;m5 = [203 0 203]./255;map=[m1;m2;m3;m4;m5];labels={'ET'; 'BSk'; 'BWh'; 'BWk'; 'Dfc'};h=colorbar;set(h,'YTickMode','manual','YTick',[1:length(map)],'YTickLabelMode','manual','YTickLabel',labels);
But in the figure only 'BWk' is marked in the midle of colorbar. How can I set correctly the colorbar?
Best Answer