On Sun, Feb 14, 2010 at 10:36 PM, David Arnold <dwarnol...@suddenlink.net>wrote:

> All,
>
> This example:
> http://matplotlib.sourceforge.net/examples/event_handling/keypress_demo.html
>
> Raises this exception o my Macbook when the key 's' is pressed:
>
> The debugged program raised the exception unhandled TypeError
> "save_figure() takes exactly 1 argument (2 given)"
> File:
> /Library/Frameworks/Python.framework/Versions/6.0.0/lib/python2.6/site-packages/matplotlib/backend_bases.py,
> Line: 1703
>

I had reported this "s" key-handling issue before at
http://old.nabble.com/Assigning-%22k%22-key-for-xscaling-td27262672.html

(By the way, I and Matthias expanding the key-handling functionality a
little bit further -configuring and deassigning keys etc... Maybe by means
of this e-mail someone can review the patch at that mail and apply to the
trunk)

And yes I am getting a similar error when I hit "s" using Qt4Agg backend on
MPL svn8105

I[1]: plt.plot(range(10))
O[1]: [<matplotlib.lines.Line2D object at 0x9fa096c>]

I[2]:
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/backends/backend_qt4.pyc
in keyPressEvent(self, event)
    150     def keyPressEvent( self, event ):
    151         key = self._get_key( event )
--> 152         FigureCanvasBase.key_press_event( self, key )
    153         if DEBUG: print 'key press', key
    154

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/backend_bases.pyc
in key_press_event(self, key, guiEvent)
   1290         s = 'key_press_event'
   1291         event = KeyEvent(s, self, key, self._lastx, self._lasty,
guiEvent=guiEvent)
-> 1292         self.callbacks.process(s, event)
   1293
   1294     def key_release_event(self, key, guiEvent=None):

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/cbook.pyc in
process(self, s, *args, **kwargs)
    167         self._check_signal(s)
    168         for func in self.callbacks[s].values():
--> 169             func(*args, **kwargs)
    170
    171

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/backend_bases.pyc
in key_press(self, event)
   1890             self.canvas.toolbar.zoom()
   1891         elif event.key == s:
-> 1892             self.canvas.toolbar.save_figure(self.canvas.toolbar)
   1893
   1894         if event.inaxes is None:

TypeError: save_figure() takes exactly 1 argument (2 given)

[gse...@ccn various]$ python sysinfo.py
================================================================================
Platform     :
Linux-2.6.31.9-174.fc12.i686.PAE-i686-with-fedora-12-Constantine
Python       : ('CPython', 'tags/r262', '71600')
IPython      : 0.10
NumPy        : 1.5.0.dev8038
Matplotlib   : 1.0.svn (python setupegg.py develop newer shows
matplotlib.__version__ correctly :)
================================================================================

Thanks.


>
> David
>
> ------------------------------------------------------------------------------
> SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
> Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
> http://p.sf.net/sfu/solaris-dev2dev
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>



-- 
Gökhan
------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to