Eric Firing wrote:
> Robert Cimrman wrote:
> [...]
>> What could be done, though, is to raise an exception explaining that 
>> sparse matrices and the image mode don't like each other; as it is, 
>> the function spy3 just dies on asarray (should be st. like asarray( 
>> Z.todense() ))
> 
> (I think it would be Z.toarray().)

Yes.

> Good point.  Alternatives would be to automatically switch it to plot 
> mode, with a warning, or to automatically convert it.  Probably the 
> former is the better of these two, and maybe your originally suggested 
> exception is best of all.  What do you think?

I am slightly more for raising the exception: IMHO, people really 
needing and using sparse matrices convert never to dense ones (they 
would not fit into memory in most cases); people happy with automatic 
conversion should use dense matrices from the very beginning - there is 
no gain in exploiting sparsity for them; people knowing what they are 
doing can convert explicitly prior to calling spy().

So:
+1 raise an exception
+0 switch to plot mode (ok, but inconsistent - why I got a plot when I 
wanted an image?)
-10 automatic conversion

r.

-------------------------------------------------------------------------
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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to