MATLAB Answers

How to assign the value to the min/max of a color map in heatmap?

21 views (last 30 days)
I need zero to be yellow and 1 to be green but it is opposite in the heatmap now:
Any idea to reverse this?


Sign in to comment.

Accepted Answer

Mohammad Sami
Mohammad Sami on 7 Apr 2020
You can flip the colormap summer to get your desired colorscheme.
f = figure;
a = heatmap(rand(10,10),'Parent',f);


Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by