matplotlib window icon

You can comment out the code in backends/

    > Well, this seems like a bug to me, then. Matplotlib
    > offers the possibility to draw to a file instead of
    > opening a window. In this case, the default window icon
    > should *not* get overridden.

FYI, if all you are using matplotlib for is to write to a file, you
can just use the Agg backend (or PS or SVG or whatever) and GTK will
never be imported and the icon won't be touched.

As an aside, if you are writing a GTK plugin you probably shouldn't be
using pylab at all, but rather the OO classes directly, as in

    > The best way to patch this would be to set the default
    > window icon only when the gtk main loop is entered.

    > I attached a patch against the current SVN. It simply
    > moves the window icon declaration just before the line
    > where gtk.main() gets called.

I don't think this is the right place to put the patch -- "show" is
for pylab only, and it may be that application developers (me for one)
who won't be using pylab or calling show (they'll start the mainloop
themselves) and who like the icon for their mpl figures. I agree that
always overriding the icon when import backend_gtk is a bit heavy
handed, though. I hate to suggest another rc param, but we could have

gtk.icon : matplotlib.svg # use None to suppress the default
                            # minimization icon or an svg file to
                            # provide your own

any better ideas?



On Thu, 2006-05-18 at 15:57 -0500, John Hunter wrote: