From: Tony S Yu <to...@MI...> - 2008-09-26 19:37:17
|
On Sep 26, 2008, at 2:28 PM, John Hunter wrote: > On Fri, Sep 26, 2008 at 12:39 PM, Tony S Yu <to...@mi...> wrote: > >> + if all(nonzero == False): >> + raise ValueError('spy cannot plot sparse zeros >> matrix') > > Is raising an exception the right choice here -- why can't we plot an > all zeros image? > > JDH I guess you could plot sparse all-zero matrices with image mode. My only hesitation is that sparse arrays tend to be very large and (I imagine) this would lead to very slow performance. I assumed this was the reason image mode wasn't adapted to use sparse arrays. Actually, now that I think about it: you could plot a trivially small image and just adjust the coordinates so that they correspond to the original matrix shape. Is this what you were thinking? I should note that a dense zero array also fails to plot with spy *if marker mode is used*. -T |