# spy

## Purpose

Visualize matrix sparsity patterns.

## Synopsis

    spy(S)
    spy(S,marksize)
    spy(S,'color')
    spy(S,'color',marksize)

## Description

`spy(S)` plots the sparsity pattern of any matrix `S`.

`spy(S,marksize)`, where `marksize` is an integer, uses the specified marker size.

`spy(S,'color')`, where `color` is a string, uses the specified color for the plot markers.

`spy(S,'color',marksize)` uses the specified color and size for the plot markers.

`S` is usually a sparse matrix, but full matrices are acceptable, in which case the locations of the nonzero elements are plotted.

`spy` replaces `format +`, which takes much more space to display essentially the same information.

## See Also

    find, gplot, symmmd, symrcm

(c) Copyright 1994 by The MathWorks, Inc.