spy
Visualize sparsity pattern of matrix
Description
spy(
plots the sparsity pattern of matrix
S
)S
. Nonzero values are colored while zero values are white. The plot
displays the number of nonzeros in the matrix, nz = nnz(S)
.
spy(___,
specifies
MarkerSize
)MarkerSize
to give the size of the markers using either of the previous
input argument combinations.
Examples
Input Arguments
Tips
spy
uses the size of the input matrix to adjust the plot aspect ratio. For tall or wide matrices, this can sometimes lead to "squeezed" plots. To undo this resizing, you can change the aspect ratio after plotting with the commandpbaspect auto
.format +
is a text-based alternative for displaying the nonzero structure of a small matrix:format + eye(4)
ans = + + + +
Extended Capabilities
Version History
Introduced before R2006a