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
#! /usr/bin/env python

import numpy as N
import pylab as P

if __name__=='__main__':

    plotdir = '/Users/randers/Desktop/'
    xx = 1000

    yy = 1000
    outfile = plotdir + 'image1.png'
    #yy = 1500
    #outfile = plotdir + 'image2.png'
    #outfile = plotdir + 'image3.png'

    data = N.empty((xx,yy))
    for i in range(xx):
        for j in range(yy):
            data[i,j] = i * i

    #data = N.rot90(data)
    P.imsave(outfile,data,format='png',origin='lower')
    print'Saved file to: ',outfile

<<attachment: image3.png>>

<<attachment: image2.png>>

<<attachment: image1.png>>

------------------------------------------------------------------------------
Get your Android app more play: Bring it to the BlackBerry PlayBook 
in minutes. BlackBerry App World&#153; now supports Android&#153; Apps 
for the BlackBerry&reg; PlayBook&#153;. Discover just how easy and simple 
it is! http://p.sf.net/sfu/android-dev2dev
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to