matplotlib.pyplot.imsave bug

Hello,

I’ve noticed a bug with matplotlib.pyplot.``imsave. Say I have an array that is 1000*1000. This works perfectly:

pylab.imsave(outfile,data,format='png',origin='lower')

`

`

and I get image1.png.

`

`

However, if the array is not a square, say 1000*1500, then the output image is rotated 90 degrees compared to the image it prints out. Example, image2.png.

`

`

I tried numpy.rot90(frame) to rotate my data, and though my data did rotate, so did the output frame. Example, image3.png.

`

`

If there is a way around this, please let me know. Otherwise, it should be fixed ;)

`

`

Cheers,

Rachel

test_imsave.py (512 Bytes)

image3.png

image2.png

image1.png

What version of matplotlib are you using? This appears to be fixed
in the latest 1.1. If you can let me know what version you’re
using, perhaps it will be easy to provide a patch if you’re not able
to upgrade wholesale.

Mike
···

http://p.sf.net/sfu/android-dev2dev


Matplotlib-devel@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/matplotlib-devel

-- Michael Droettboom
Science Software Branch
Space Telescope Science Institute
Baltimore, Maryland, USA