Plot confusion matrices in proper way

I want to plot this figures below in Matlab?

댓글 수: 4

Walter Roberson
Walter Roberson 2022년 4월 10일
What is the difference between what you want and what you would get from https://www.mathworks.com/help/deeplearning/ref/plotconfusion.html ?
Mubarak Alanazi
Mubarak Alanazi 2022년 4월 10일
I want to write the numbers manually ?
Walter Roberson
Walter Roberson 2022년 4월 10일
text() them into position ?
Mubarak Alanazi
Mubarak Alanazi 2022년 4월 10일
I don't know how ?

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2022년 4월 10일

0 개 추천

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

Mubarak Alanazi
Mubarak Alanazi 2022년 4월 10일
how about the labels and background blue, same the figure above?
Walter Roberson
Walter Roberson 2022년 4월 10일
편집: Walter Roberson 2022년 4월 10일
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.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Color and Styling에 대해 자세히 알아보기

질문:

2022년 4월 10일

편집:

2022년 4월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by