John Hunter wrote:
>>>>>> "Eric" == Eric Firing <[EMAIL PROTECTED]> writes:
>
> Eric> Yes, it should be !=0. The purpose is to show how sparse a
> Eric> matrix is--how much is filled with zeros--by displaying the
> Eric> 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)
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users