MATLAB: Imagesc make all zeros white

imagescMATLAB

I have the following code. The output is a matrix and I want all of the zeros to be displayed as white. How can I do this?
figure (1)
imagesc(testNSE);
title ('Model vs Observations All NSE')
caxis ([0,1])
colormap(jet)
colorbar
Thank you in advance for any help

Best Answer

Set the first row of the colormap, which will represent 0 since you set up caxis to go from 0 to 1, to be [1,1,1];
myColorMap = jet(256);
myColorMap(1,:) = 1;
colormap(myColorMap);
colorbar
Related Question