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

19 visualizaciones (últimos 30 días)
I need zero to be yellow and 1 to be green but it is opposite in the heatmap now:
Any idea to reverse this?

Respuesta aceptada

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

Más respuestas (3)

Domenico Lucia
Domenico Lucia el 7 de En. de 2021
Hi, i need something similar. I used HeatMap function ad i obtained the two charts in attachment. The max values for the two charts are 1 an 0.857. On the two charts the maxi values (1 and 0.857) have the same color green. I need to rescale the second chart to the maximum value 1 in order to obtain the same colours for the same values in the two charts.

Domenico Lucia
Domenico Lucia el 7 de En. de 2021

sogol bandekian
sogol bandekian el 21 de Mayo de 2022
I have same question,How can I show the max and min of bi-variate function with colormap?

Categorías

Más información sobre Colormaps en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by