On 7/10/07, Devin Halperin <[EMAIL PROTECTED]> wrote:
> I'm trying to figure out why this command is taking on average over 14
> seconds to render a drawing of a fairly simple plot.  If anyone has ideas,
> I'd really appreciate some help.

> fig = figure(figsize=(12.5,3.75), dpi=80,facecolor = 'y', edgecolor='b')
///snip
> canvas = FigureCanvasAgg(fig)

You can't do this.  You are combining pylab figure management (eg
figure) with explicit use of FigureCanvasAgg.  Who the hell knows what
will happen.

If you want to use pylab, just create the figure as above and you can
access the cancas directly w/ fig.canvas and set your backend to Agg,
eg with

import matplotlib
matplotlib.use('Agg')

before importing pylab.

If you don't want to use pylab, follow the approach of

http://matplotlib.sf.net/examples/agg_oo.py

Note there we use matplotlib.figure.Figure to create the figure, not
pylab.figure.

This is probably your problem.  If I were to guess, you are getting
caught up somewhere in some GUI nastiness inadvertently by using
pylab.figure and this is causing the slowdown.

JDH

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to