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
--
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
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')
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
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
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()
>
> #
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
---
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
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
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
10 matches
Mail list logo