How can I invert the distribution of colors in a colormap, in MATLAB 8.1 (R2013a)?
1,149 views (last 30 days)
Show older comments
MathWorks Support Team
on 25 Oct 2013
Answered: MathWorks Support Team
on 25 Oct 2013
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?
Accepted Answer
MathWorks Support Team
on 25 Oct 2013
The solution in this case would be to flip the values of the colormap, using the command:
colormap(flipud(hot))
0 Comments
More Answers (0)
See Also
Categories
Find more on Colormaps in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!