I'm plotting a confusion matrix as the following with colorbar in it:
What I would like to do now is keep everything exactly the same, but inverse the colors. I have tried the following code (which I read from another post in SOF):
myimage = sum(255 - myimage, 3);
And this gives me:
And this is exactly what I want, with the exception that the values in the colorbar have changed...How can I do the same thing without changing the values in the colorbar?
Thank you for any help =)
You can change the color scheme by specifying a colormap. Colormaps are three-column arrays containing RGB triplets in which each row defines a distinct color. For example, here is a surface plot with the default color scheme. f = figure; surf(peaks);
If you have not specified a different default value, then the default colormap is parula .
why wont you just invert the colormap by flipping up-down (flipud
)? For example:
cmap=flipud(colormap(gray));
colormap(cmap);
or in a more compact way:
imagesc(your_image);
colormap(flipud(gray))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With