On Tuesday 04 December 2007 16:05:33 John Hunter wrote:
> On Dec 4, 2007 10:00 AM, José Gómez-Dans <[EMAIL PROTECTED]> wrote:
> > Interestingly enough, the embedding_in_gtk.py script works perfectly
> > (takes less than a second to run), so I am not able to reproduce the
> > slowness!
>
> Hmm, the plot thickens.  How about embedding_in_gtk2.py -- this add the
> toolbar

This does indeed slow things down. The minimal script that reproduces this 
behaviour is the following (the delay appears round about the definition of 
toolbar):

import gtk
from matplotlib.axes import Subplot
from matplotlib.figure import Figure
from numpy import arange, sin, pi
from matplotlib.backends.backend_gtk import FigureCanvasGTK as FigureCanvas
from matplotlib.backends.backend_gtk import NavigationToolbar2GTK \
        as NavigationToolbar
win = gtk.Window()
win.connect("destroy", lambda x: gtk.main_quit())
win.set_default_size(400,300)
win.set_title("Embedding in GTK")
fig = Figure(figsize=(5,4), dpi=100)
canvas = FigureCanvas(fig)
toolbar = NavigationToolbar(canvas, win)
# ^ Delay appears here
win.add(toolbar)
win.show_all()
gtk.main()

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to