MATLAB: How to change color to an imagesc graph

imagesc colorbar

Hi! A project I‘m working on involves doing a color graph to show a 2D array. I used imagesc() to do it and showed the colorbar. In the color graph, the value 0 corresponds to color blue. Is there a way to change the color in the imagesc() function so that I could assign a specific color to a specific value?
Thank you!!

Best Answer

https://www.mathworks.com/matlabcentral/answers/77736-how-to-change-colorbar-s-color-in-some-particular-value-interval
Related Question