How to plot binary matrix as dots?
Show older comments
I have a Matrix with ones and zeroes. How to plots the matrix with zeroes as black spot and ones as whote dots as shown in figure below.

Accepted Answer
More Answers (3)
millercommamatt
on 15 Sep 2021
FH = figure;
imagesc(yourMatrix);
colormap(FH,[0,0,0;1,1,1]);
M = magic(7);
B = M > mean(M);
colormap('gray')
imagesc(B)
axis square
imshow(yourMatrix)
Categories
Find more on Graphics Performance in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

