[Matplotlib-users] savefig not deducing file format

2011-03-15 Thread Giovanni Luca Ciampaglia
Hi all, I call savefig by passing to it a file-like object but it appears to not get the graphics format right: f = open('not_a_pdf.pdf', 'w') plot([1,2,3]) savefig(f) but it produces a PNG image. Can anybody confirm this? I am on matplotlib 0.99.3 Cheers, Giovanni --

Re: [Matplotlib-users] savefig not deducing file format

2011-03-15 Thread Michael Droettboom
It has no way of deducing the file format from the file object. You need to explicitly pass the format keyword to savefig, e.g.: savefig(f, format='pdf') Mike On 03/15/2011 07:11 AM, Giovanni Luca Ciampaglia wrote: > Hi all, > I call savefig by passing to it a file-like object but it appears

Re: [Matplotlib-users] savefig not deducing file format

2011-03-15 Thread Giovanni Luca Ciampaglia
My fault, I didn't read the docstring properly. Thanks for both replies. Best, G On 15/03/2011 13:51, Michael Droettboom wrote: > It has no way of deducing the file format from the file object. > > You need to explicitly pass the format keyword to savefig, e.g.: > > savefig(f, format='pdf')

Re: [Matplotlib-users] savefig not deducing file format

2011-03-15 Thread Alan G Isaac
On 3/15/2011 8:51 AM, Michael Droettboom wrote: > It has no way of deducing the file format from the file object. Inspect f.name? Alan Isaac -- Colocation vs. Managed Hosting A question and answer guide to determining t

[Matplotlib-users] Re : alternative to imshow with polar axes ?

2011-03-15 Thread Auré Gourrier
Really no one to point me in the right direction ? This is really important, I'm trying to wrap up a publication and this is the only element missing... De : Auré Gourrier À : matplotlib-users@lists.sourceforge.net Envoyé le : Jeu 10 mars 2011, 15h 40min 04s

Re: [Matplotlib-users] Re : alternative to imshow with polar axes ?

2011-03-15 Thread Michael Droettboom
Can you provide a standalone example? This below is missing some imports and there are some mystery variables. Mike On 03/15/2011 12:25 PM, Auré Gourrier wrote: > import matplotlib as mpl > from matplotlib import pylab > import numpy as np > > #build custom colormap > cm_sym =customfunc() > > #

[Matplotlib-users] Imshow x and y transposed?

2011-03-15 Thread Tom Dimiduk
It appears to me that when imshow tells you that the mouse cursor is at x=50, y=100 That corresponds to array element im[100, 50] Is there a reason imshow does not have x be the first coordinate of the array as I would think of as conventional usage? Tom ---

Re: [Matplotlib-users] Imshow x and y transposed?

2011-03-15 Thread Eric Firing
On 03/15/2011 10:23 AM, Tom Dimiduk wrote: > It appears to me that when imshow tells you that the mouse cursor is at > x=50, y=100 > > That corresponds to array element > im[100, 50] > > Is there a reason imshow does not have x be the first coordinate of the > array as I would think of as conventio

Re: [Matplotlib-users] Imshow x and y transposed?

2011-03-15 Thread Tom Dimiduk
Ah thanks. I am used to the general math/physics convention of x axis being first. Caught between conventions I guess. Good to know why things are done differently. I am using the mouse click event.xdata and event.ydata as indexes into an array. From what you say, it looks like I want to us

Re: [Matplotlib-users] Imshow x and y transposed?

2011-03-15 Thread Eric Firing
On 03/15/2011 11:47 AM, Tom Dimiduk wrote: > Ah thanks. I am used to the general math/physics convention of x axis > being first. Caught between conventions I guess. Good to know why > things are done differently. > > I am using the mouse click event.xdata and event.ydata as indexes into > an ar