Azzera filtri
Azzera filtri

how can i add the numers on the heatmap?

17 visualizzazioni (ultimi 30 giorni)
myrto pieridou
myrto pieridou il 8 Lug 2022
Commentato: myrto pieridou il 18 Lug 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 Commenti
Adam Danz
Adam Danz il 8 Lug 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 il 18 Lug 2022
Thank you soooo much!!!!!

Accedi per commentare.

Risposte (1)

Adam Danz
Adam Danz il 8 Lug 2022
Modificato: Adam Danz il 13 Lug 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.

Categorie

Scopri di più su Data Distribution Plots in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by