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

2011-03-25 Thread Giovanni Luca Ciampaglia
Ah, sorry for the duplicate message! Cheers, G On 15/03/2011 11:30, Giovanni Luca Ciampaglia wrote: > 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 pro

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

2011-03-25 Thread Fabrice Silva
Le mardi 15 mars 2011 à 11:30 +0100, Giovanni Luca Ciampaglia a écrit : > 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 anybo

[Matplotlib-users] savefig not deducing file format

2011-03-25 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 L. Ciampaglia PhD Studen

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

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 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

[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 --