On Mon, Oct 5, 2009 at 10:25 PM,  <jason-s...@creativetrax.com> wrote:
> Jae-Joon Lee wrote:
>>
>> As one of who never used Sage, I don't think I'll be any help here.
>> Anyhow, can you tell us what kind of backed is used by default in the
>> two environment? I mean the type of the canvas that is initially
>> created.
>>
>
> Thanks for following up on this.  Is there an easy way to ask matplotlib
> what its default canvas is (i.e., what canvas pyplot will use for savefig)?
>  I believe it's probably using the FigureCanvasAgg canvas, but I'm not sure.
>  Since I've reproduced the problem with pure matplotlib code, I'm not sure
> where the canvas is set up and initialized.
>

In [17]: fig = plt.figure()

In [18]: print type(fig.canvas)
<class 'matplotlib.backends.backend_gtkagg.FigureCanvasGTKAgg'>

See if matplotlib session and sage session uses different backend.

>
>> It seems to be some dpi issue, but MPL supposed to handle this correctly.
>> I guess it also works fine if the figure is initially created with the
>> matching dpi as the savefig (72),?
>>
>
> I'm not sure what you're asking here or how to test your assumption.  I
> posted the code that gave the problem in a Sage session, but worked fine in
> a normal python session.  I also saw the problem (cut-off bottom in firefox,
> which looked like a transparent bottom portion of the figure in gimp) with
> varying amounts when I specified other dpi values.  Is there something I can
> insert into my script to test what you're asking?
>

plt.figure takes dpi parameter. This is the dpi of the figure instance
(not the output).  Set this to same value as one you use for savefig.

> Again, I'm really puzzled by this.  We are using just pure matplotlib, and
> yet, there seems to be something in the Sage configuration or environment or
> something that is causing pure matplotlib code to generate these erroneous
> figures, but the exact same installation of matplotlib, when run under
> python, generates perfectly fine figures.

I do not have any clue either. However, one possibility I can think of
is that it is a bug in certain backend whose savefig command does not
take care of changing dpi correctly. If it turns out that the sage
session and ipython session uses a same backend, then, I have no idea.
I hope some other developer who uses sage take a look at this.

Regards,

-JJ


>
> Thanks,
>
> Jason
>
>
>
>
>
>

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to