'how to add a bar specifying number of each color in a colored matrix in matlab?
i have a matrix that i colored in green/blue/white according to the values in the cell of each matrix (1-green , 2-blue , 0-white)
i want to add a bar to the graph that specifys how much green and blue cells there are.
this is how i colored the matrix :
figure;
hp = pcolor(padarray(MY_MATRIX(:,:,1),[1 1],'replicate','post'));
hp.EdgeColor = [0 0 0];
hp.LineWidth = 2;
colormap([1 1 1;0 1 0;0 0 1;]);
i want to have something like this maybe:
green-25
blue-13
thank you in advance.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
