spy ignores negative values?

Yes, it should be !=0. The purpose is to show how sparse a

    > matrix is--how much is filled with zeros--by displaying the
    > non-zero entries.

OK I fixed it. Thanks.

JDH

John Hunter wrote:

    > Yes, it should be !=0. The purpose is to show how sparse a
    > matrix is--how much is filled with zeros--by displaying the
    > non-zero entries.

OK I fixed it. Thanks.

Thanks!

BTW would you consider changing the definition of spy(2) as shown below,
so that one could specify what 'to be a zero' means?

r.

def spy(self, Z, precision = None, marker='s', markersize=10, **kwargs):

    if hasattr(Z, 'tocoo'):
        c = Z.tocoo()
        if precision is None:
            x = c.row
            y = c.col
            z = c.data
        else:
            ii = where( abs( c.data ) > precision )[0]
            x = c.row[ii]
            y = c.col[ii]
            z = c.data[ii]
    else:
        if precision is None:
            x,y,z = matplotlib.mlab.get_xyz_where(Z, Z != 0)
        else:
            x,y,z = matplotlib.mlab.get_xyz_where(Z, abs( Z ) > precision)

    return self.plot(x+0.5,y+0.5, linestyle='None',
                     marker=marker,markersize=markersize, **kwargs)