How can I invert the distribution of colors in a colormap, in MATLAB 8.1 (R2013a)?

232 vues (au cours des 30 derniers jours)
For example, in the following figure
load flujet
image(X)
colormap(hot)
colorbar
the colormap's lower value is dark red/black, while its higher value is yellow/white.
Is there a way to flip the colormap (i.e. lower numerical values to be yellow/white and higher numerical values to be represented as darkred/black) without having to create a new colormap manually?

Réponse acceptée

MathWorks Support Team
MathWorks Support Team le 25 Oct 2013
The solution in this case would be to flip the values of the colormap, using the command:
colormap(flipud(hot))

Plus de réponses (0)

Catégories

En savoir plus sur Color and Styling dans Help Center et File Exchange

Tags

Aucun tag saisi pour le moment.

Produits


Version

R2013a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by