I am using imshow()
to visualize data obtained from the difference of two grayscale images. The images are masked, i.e. each pixel 'laying under' the mask has the value NaN
. The data are represented by the parula
colormap. The problem is that imshow()
treates NaN
as zero and therefore the masked pixels are represented as blue. Is there an easy way to omit the masked pixels or to display them in a color that is not part of the colormap (e.g. white, gray, or black)?
I would prefer the solution to base on imshow()
since it would be easiest to include into my code. However, solutions using pcolor
, imagesc
or the like will also be appreciated.