I want to plot a sparse matrix in an imagesc
type of style (one color for each pixel, and not symbols a la scatter
). The matrix consists of blobs that are spread ut over a 10000x10000 square. I expect about 100 blobs and each blob being 50x100 pixels. This matrix is so big that it becomes very laggy to zoom in or out or to move around in it to inspect the data. And I still want to keep the resolution. Is there any way to plot a sparse matrix which just plots the blobs and has the "zero-color" of the colormap as a background that does not take any space in memory?
Lets say we have a matrix M that looks like this:
[1, 2, 1, 0;
0, 1, .4, 0;
0, 0, 0, 0;
0, 7, 0, 0]
When I plot it as a sparse matrix
figure;
imagesc(sparse(M));
It takes the same size as omitting the sparse-command. This is what I want to circumvent.