I just uploaded a bugfix to the repository, using *args in all the save_figure 
methods and removing the extra argument in the call to save_Figure.

--Michiel.

--- On Wed, 2/17/10, John Hunter <jdh2...@gmail.com> wrote:

> From: John Hunter <jdh2...@gmail.com>
> Subject: Re: [Matplotlib-users] Easy come easy go
> To: "Michiel de Hoon" <mjldeh...@yahoo.com>
> Cc: matplotlib-users@lists.sourceforge.net, "David Arnold" 
> <dwarnol...@suddenlink.net>
> Date: Wednesday, February 17, 2010, 9:16 AM
> On Wed, Feb 17, 2010 at 7:41 AM,
> Michiel de Hoon <mjldeh...@yahoo.com>
> wrote:
> > An inconsistency in the definition of save_figure
> between different backends is causing this problem.
> >
> > The GTK backends use
> >    def save_figure(self, button):
> >
> > but the tkagg, qt, qt4, and macosx backends use
> >    def save_figure(self):
> >
> > so without the second argument. The line that is
> causing the error is
> >
> >          
>  self.canvas.toolbar.save_figure(self.canvas.toolbar)
> >
> > in backend_bases.py. This assumes that the save_figure
> method is defined as in the GTK backends.
> >
> > As far as I can tell, the GTK backend has the second
> argument because that is what pygtk passes when save_figure
> is called as a callback. The second argument is not actually
> used inside the method.
> >
> > So I would suggest the following:
> >
> > In backend_bases.py, change the offending line to
> >
> >            self.canvas.toolbar.save_figure()
> >
> > and the backend_gtk, change the definition of the
> save_figure method to
> >
> >    def save_figure(self, button-None):
> >
> > Any objections, anybody?
> 
> 
> The base class signature is
> 
>     def save_figure(self, *args):
>         'save the current figure'
>         raise NotImplementedError
> 
> But I think the problem is the line
> 
>  
> self.canvas.toolbar.save_figure(self.canvas.toolbar)
> 
> it shouldn't be passing the toolbar in, but should just
> read
> 
>   self.canvas.toolbar.save_figure()
> 
> We could make both changes -- make sure all the signatures
> of the
> derived classes comply with
> 
>      def save_figure(self, *args):
> 
> and remove the self.canvas.toolbar argument from the
> save_figure call.
> 
> Michiel, do you want to take the lead on this?
> 
> JDH
> No?
> 


      

------------------------------------------------------------------------------
Download Intel&reg; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs 
proactively, and fine-tune applications for parallel performance. 
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to