Hi all,
I am trying to overlay a colour image on a grey level image. However, when I try to plot the 'colorbar' and set the 'clim'. Matlab always produce a colorbar according to the underneath grey level image.
However, I want to get the colorbar for the overlaid colour image. Any suggestions would be appreciate. Thanks a lot.
%%Example codes:
greyImage = imread('AT3_1m4_08.tif');colorImage = imread('hestain.png');figure,greyImagePlot = image(greyImage); colormap(gray); hold on;overlayImage = imagesc(colorImage, ... 'CDataMapping', 'scaled', 'HitTest', 'off');alF = 0.5.*ones(size(colorImage, 1), size(colorImage, 2));set(overlayImage, 'AlphaData', alF);colorbar; % This will show a grey scale colorbar not the colour one I want
set('CLim', [0 100]); % Also, the colormap limit here is not working
axis off axis image
Best Answer