I know there are similar post but I was unable to get them working. Attached is one matfile which contains 2 variables. I would like the colormap (Tmap) overlayed on a gray-scaled imaged on the variable 'x'. I also need all the zeroes not to show and and a colorbar shown on the side. Thanks for the assistance. You can see what I tried to do to get it working. Thanks for the help.
figure; imagesc(Tmap); colormap(jet); colorbar;mask=Tmap>0;figure; imshow(mask);overlayImage=gray2ind(double(Tmap)/max(Tmap(:)),128);overlayRGB=ind2rgb(overlayImage,jet(128));x=im2double(x);x=gray2ind(double(x)/max(x(:)),128);vvv=[37 45]; %Set the colorbar axis
h=subimage(x);set(h,'AlphaData',mask);imagesc(Tmap);colormap(jet);colorbar; caxis(vvv);hold on;h=subimage(x);set(h,'AlphaData',~mask)h=gcf;saveas(h,'NiceTherm')
Best Answer