Reputation: 1692
I have a confusion matrix like this:
[1 0 0 0 0 ]
[0 0.9 0 0.1 0 ]
[0 0 1 0 0 ]
[0 0 0 1 0 ]
[0.1 0 0.2 0 0.7]
where rows represent ground of truth, columns represent classification result. I would like to plot it graphically in a grid. I tried surface
but it only shows a 4x4 figure whilst my matrix has 5x5 size.
how can i do that?
Upvotes: 1
Views: 8870
Reputation: 8391
You want your confusion values to define cell values instead of node values (as surface
does).
You can use imshow
for your purpose, maybe combined with some colormap
.
A = [1 0 0 0 0
0 0.9 0 0.1 0
0 0 1 0 0
0 0 0 1 0
0.1 0 0.2 0 0.7 ]
imshow(A, 'InitialMagnification',10000) % # you want your cells to be larger than single pixels
colormap(jet) % # to change the default grayscale colormap
Upvotes: 5