I have two images:
orgImage, which is a 1298×320 matrix of values that I wish to show in gray scale.
And
ChemMap, which is a 1298×320 matrix where a majority of the elements are NaNs, but some of which are values that I want to plot on top of orgImage with a colormap such as jet for example.
Plotting these on top of each other should be the simplest thing in the world but I have literally been trying for hours to get it the way I want it to but it doesn’t work.
First I was hoping to be able to start by plotting image number one like:
imagesc(orgImage), colormap('gray'),axis equal, hold on
and then add the other one on top;
imagesc(ChemMap), colormap('jet')
But that doesn’t work since the NaN’s are still plotted on the image but as the lowest possible value of the jet colormap.
I’ve tried plotting the images on different axis as suggested here: https://se.mathworks.com/matlabcentral/answers/101346-how-do-i-use-multiple-colormaps-in-a-single-figure
and I’ve tried messing around with the freezeColors routine on fileexchange but I can’t quite get it to work which is overwhelmingly frustrating.
Does anyone know how I can make the NaN’s transparent in imagesc(ChemMap) so I can plot these images on top of each other?
Thanks.
Best Answer