SPY SPY Visualize Sparsity Pattern of a Sparse Matrix Usage Plots the sparsity pattern of a sparse matrix. The syntax for its use is spy(x) which uses a default color and symbol. Alternately, you can use spy(x,colspec) where colspec is any valid color and symbol spec accepted by plot.