Borrar filtros
Borrar filtros

how can i add the numers on the heatmap?

15 visualizaciones (últimos 30 días)
myrto pieridou
myrto pieridou el 8 de Jul. de 2022
Comentada: myrto pieridou el 18 de Jul. de 2022
cdata=[1.6 1.6 1.6,1.6,1.6 1.6 1.6 1.6 1.1 1.1 1.1 1.3 1.3 1.3 4.5 1.6 1.6 1.6 1.6 1.6 1.6 1.6 2.3 2.3 1.6 1.6 1.6 1.6 1.6 1.6 1.6 1.6 5.6; %33
1.1 1.1 0.79 0.79 1.1 1.1 0.79 0.79 0.93 0.93 0.93 1.1 1.1 1.1 1.1 0.46 0.46 0.46 0.46 0.46 0.43 0.43 1.6 1.6 1.1 1.1 1.1 1.1 1.1 1.1 0.43 0.43 1.6; %32
1.1 1.1 0.79 0.79 1.1 1.1 0.79 0.79 0.93 0.93 0.93 1.1 1.1 1.1 1.1 0.46 0.46 0.46 0.46 0.46 0.43 0.43 1.6 1.6 1.1 1.1 1.1 1.1 1.1 1.1 0.43 0.43 1.6; %31
1.6 1.6 1.0 1.0 1.6 1.6 1.0 1.0 1.3 1.3 1.3 1.6 1.6 1.6 1.6 1.1 1.1 1.1 1.1 1.1 1.1 1.1 1.6 1.6 1.6 1.6 1.6 1.6 1.6 1.6 1.1 1.1 1.6; %30
1.6 1.6 1.0 1.0 1.6 1.6 1.0 1.0 1.3 1.3 1.3 1.6 1.6 1.6 1.6 1.1 1.1 1.1 1.1 1.1 1.1 1.1 1.6 1.6 1.6 1.6 1.6 1.6 1.6 1.6 1.1 1.1 1.6; %29
1.6 1.6 1.0 1.0 1.6 1.6 1.0 1.0 1.3 1.3 1.3 1.6 1.6 1.6 1.6 1.1 1.1 1.1 1.1 1.1 1.1 1.1 1.6 1.6 1.6 1.6 1.6 1.6 1.6 1.6 1.1 1.1 1.6; %28
1.6 1.6 1.0 1.0 1.6 1.6 1.0 1.0 1.3 1.3 1.3 1.6 1.6 1.6 1.6 1.1 1.1 1.1 1.1 1.1 1.1 1.1 1.6 1.6 1.6 1.6 1.6 1.6 1.6 1.6 1.1 1.1 1.6; %27
1.6 1.6 1.0 1.0 1.6 1.6 1.0 1.0 1.3 1.3 1.3 1.6 1.6 1.6 1.6 1.1 1.1 1.1 1.1 1.1 1.1 1.1 1.6 1.6 1.6 1.6 1.6 1.6 1.6 1.6 1.1 1.1 1.6; %26
1.6 1.6 1.0 1.0 1.6 1.6 1.0 1.0 1.3 1.3 1.3 1.6 1.6 1.6 1.6 1.1 1.1 1.1 1.1 1.1 1.1 1.1 1.6 1.6 1.6 1.6 1.6 1.6 1.6 1.6 1.1 1.1 1.6; %25
];
xvalues=[1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33];
yvalues=[1 2 3 4 5 6 7 8 9 ];
h=heatmap(xvalues,yvalues,cdata);
  2 comentarios
Adam Danz
Adam Danz el 8 de Jul. de 2022
I edited your question to remove the screen shot and replace it with the figure generated by the "run feature". I also formatted your code.
This can all be achieved by using tools in the toolbar when editing your question.
myrto pieridou
myrto pieridou el 18 de Jul. de 2022
Thank you soooo much!!!!!

Iniciar sesión para comentar.

Respuestas (1)

Adam Danz
Adam Danz el 8 de Jul. de 2022
Editada: Adam Danz el 13 de Jul. de 2022
The cell values in heatmap appear when the figure is large enough to fit them in. Increase your figure size or decrease the density of the heatmap to make space for the text labels.
You can programmatically maximize the figure using
set(gcf, 'WindowState', 'maximized')
Alternatively, you can create a heatmap look-alike using imagesc which is demo'd here. The text labels won't disappear in this workaround.

Categorías

Más información sobre Data Distribution Plots 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