I do more or less the following:
figure for ii=1:4 subplot(2,2,ii) imshow(image(ii)) hcb = colorbar; switch ii case 1 colormap(myMap) set(hcb,'YTickLabel', .. ) set(hcb,'YTick', .. ) case 2 colormap(myMap) set(hcb,'YTickLabel', .. ) set(hcb,'YTick', .. ) case 3 colormap(myMap) set(hcb,'YTickLabel', .. ) set(hcb,'YTick', .. ) case 4 colormap(aDifferentMap) set(hcb,'YTickLabel', .. ) set(hcb,'YTick', .. ) end end
It seems to me that calling colormap(aDifferentMap) for the fourth plot ( ii=4 ) twists things for the previous three graphs: in my last figure, all the color panels have aDifferentMap colormap, as well as some problems with the YTick attribute.
If I comment on colormap(aDifferentMap) in case 4, everything works well (except for the fourth subtitle, which will have the wrong color palette and without Ytickes).
How can I handle this? How to set subplot(2,2,4) properties without affecting 1: 3 subheadings?
source share