change tick values heat map
10 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I want to set ticks to my heat map figure. I don't find any options to do it. It has automatically set it with numbers. also I want to add subscripts to the values inside the boxes.
0 commentaires
Réponse acceptée
Chunru
le 1 Juil 2022
It seems that "heatmap" has no properties for changing display text. You can use imagesc instead:
data = rand(4);
imagesc(data); colorbar
h = gca;
h.XTick= 1:4;
h.XTickLabel = ["A", "B", "C", "D"];
[xx, yy] = meshgrid(1:4, 1:4);
str = string(data(:));
str(1) = str(1)+"^B"; % Now you can specify the text anyway you like. This is an example
text(xx(:), yy(:), str, 'HorizontalAlignment', 'center')
4 commentaires
Plus de réponses (1)
Chunru
le 30 Juin 2022
cdata = rand(3,3);
h = heatmap(cdata);
h.XData = ["A", "B", "C"];
h.YData = ["A_1", "B_1", "C_1"];
3 commentaires
Voir également
Catégories
En savoir plus sur Data Distribution Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!