I'm doing 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
What I'm facing is that calling colormap(aDifferentMap)
for the fourth plot (ii=4
), screws things up for the previous three plots: in my final figure all colorbars have aDifferentMap
colormap, with also some problems to the YTick
attribute.
If I comment out colormap(aDifferentMap)
in case 4, it all works well (except for the fourth subplot, which will have a wrong colormap and no Ytickes whatsoever).
How can I deal with this? How can I set properties of subplot(2,2,4)
without influencing subplots 1:3?
freezeColors
author. – Ir