[SciPy-dev] Patch for broken scipy.plt.plot_objects.py

A.Schmolck a.schmolck at gmx.net
Mon Jan 21 10:05:00 EST 2002


Hi,

I didn't find anything specific on the www.scipy.org on how to submit patches,
so I hope submitting them here is OK.

I hit upon a bug in plt.imagesc, that took me quite a long time to track
down. Basically, it won't display any non-square matrices correctly. However,
reshaping a flat array (which I happen to mostly work with), incorrectly
(i.e. reshape(a.flat,(col, row)) instead of reshape(a.flat, (row, col))), will
result in the plot one expected. I was therefore quite dumbfounded when I
found that plt.imagesc(reshape(a.flat,(col, row))) worked but
plt.imagesc(transpose(reshape(a.flat,(col,row)))) produced garbage.

Here is a fix (plus anoter small change), which I hope should work.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: plot_objects.py.PATCH
Type: text/x-patch
Size: 1867 bytes
Desc: patch for plot_objects.py
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20020121/023c4a88/attachment.bin>
-------------- next part --------------


alex

-- 
Alexander Schmolck     Postgraduate Research Student
                       Department of Computer Science
                       University of Exeter
A.Schmolck at gmx.net     http://www.dcs.ex.ac.uk/people/aschmolc/


More information about the SciPy-Dev mailing list