Reverse/flip values in the colorbar axis

136 views (last 30 days)
Turbulence Analysis
Turbulence Analysis on 15 Oct 2020
Commented: Bjorn Gustavsson on 28 Apr 2022
In the attached figure, I have reverse the values in the color bar i.e. red to be positive and blue to be negative. Please help me with this. I have tried flipud, but it changes the color pattern in the contour.

Answers (1)

Bjorn Gustavsson
Bjorn Gustavsson on 15 Oct 2020
Edited: Bjorn Gustavsson on 15 Oct 2020
If you want exactly that colormap, but flip it you can do this:
cmp = colormap;
cmp = flipud(cmp);
You should be able to re-set the colormap to jet in one call:
Bjorn Gustavsson
Bjorn Gustavsson on 28 Apr 2022
Not that I disagree with your request for additional colormap-utilities, but "teribly cumbersome" might be a bit of an exageration for what can be done with something as simple as a one-liner:
that is only 26 characters...

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!