Question

Defult heatmap

Hi. I am using image() to show my two dimensional matrix as a heatmap, but the problem is that high values are showed in blue colors (cold ones). How to reverse the colors? Thank You for all replies.

Was it helpful?

Solution

From the first hit on Google: colormap(flipud(colormap))


Or else you could just invert the image itself before showing it rather than the colourmap. I'm assuming either your data goes from 0 - 1 or from 0 - 255 so instead of

imshow(I) or imagesc(I) or ... image(I)? you can go imshow(1 - I) or imshow(255 - I)


otherwise you could create a custom colormap.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top