Plot binary matrix as dot
Mostrar comentarios más antiguos
Hi,
I have this matrix that indicates a location [0 0 0 0 1 0 1 1 0 0 1 0 0 0]. I want to plot the value of 1 from this matrix using dot as the marker. How can I do it?
Thanks.
1 comentario
maxanto
el 18 de Jun. de 2021
spy([1 1 0; 0 0 0; 1 0 1])
Respuesta aceptada
Más respuestas (2)
maxanto
el 18 de Jun. de 2021
1 voto
spy([1 1 0; 0 0 0; 1 0 1])
the cyclist
el 25 de Jun. de 2015
Editada: the cyclist
el 25 de Jun. de 2015
One guess at what you want. If this is not what you want, I suggest you add detailed explanation.
figure x = [0 0 0 0 1 0 1 1 0 0 1 0 0 0]; x(x==0) = NaN; % Changing the value of x. If you need it preserved, save to a new variable. h = plot(1:numel(x),x,'k.'); set(h,'MarkerSize',24) xlim([0.5 numel(x)+0.5])

Categorías
Más información sobre Annotations en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!