Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to plot a zero-one matrix that will look like scatter?

Tags:

matrix

matlab

I have a matrix of zeros and ones and I want to plot the ones in their location in the matrix. So that it will look like the matrix but instead of ones a marker and instead of zeros nothing. Is there a function for doing this or I need to get the x and y for every one and then just do a simple scatter plot? Thank you for the help!

like image 495
user1106326 Avatar asked Dec 20 '11 09:12

user1106326


2 Answers

Try the function spy, it plots a blue dot for every non-zero entry of a matrix.

like image 116
Boris Avatar answered Sep 30 '22 16:09

Boris


imagesc

is an approach for this that I find useful.

like image 22
John Avatar answered Sep 30 '22 16:09

John