Plot confusion matrices in proper way
6 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I want to plot this figures below in Matlab?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/959685/image.png)
4 commentaires
Réponses (1)
Walter Roberson
le 10 Avr 2022
W1row = [0.96, 0.1, 0, 0, 0];
W1row_text = compose("%0.02f", W1row);
W1row_x = 0.5:1:4.5;
W1row_y = 0.5 * ones(1,length(W1row_x));
text(W1row_x, W1row_y, W1row_text)
xlim([0 5]); ylim([0 5])
xticks(W1row_x); xticklabels({'W1', 'W2', 'W3', 'W4', 'W5'});
yticks(W1row_x); yticklabels({'W1', 'W2', 'W3', 'W4', 'W5'});
set(gca, 'YDir', 'reverse')
2 commentaires
Walter Roberson
le 10 Avr 2022
Modifié(e) : Walter Roberson
le 10 Avr 2022
image() first, and colormap() and then colorbar(); then text() afterwards.
Changing the color of the text depending on the background is a bit more of a nuisance.
Voir également
Catégories
En savoir plus sur Annotations 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!