[SciPy-user] ginput() causes error with TkAgg and imshow()

n.l.o magnusp at astro.su.se
Wed May 13 06:01:18 EDT 2009


Hello
I am trying to do a ginput() on a imshow() of a image (fits-file, 512x512).
When doing it the first time since invoking python I get the error below. I
get it when using the TkAgg AND Qt4(Agg) backends, but NOT with the WX
backend.
Anyone that knows what to do? Is it a bug, if so where do I post it?


Cheers
Magnus 



In [6]: pl.ginput()
/usr/lib/python2.6/dist-packages/matplotlib/backend_bases.py:1557:
DeprecationWarning: functions overriding warnings.showwarning() must support
the 'line' argument
  warnings.warn(str,DeprecationWarning)
ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (70, 0))

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)

/home/magnusp/msc/reduction/<ipython console> in <module>()

/usr/lib/python2.6/dist-packages/matplotlib/pyplot.pyc in ginput(*args,
**kwargs)
    356     If *timeout* is negative, does not timeout.
    357     """
--> 358     return gcf().ginput(*args, **kwargs)
    359 if Figure.ginput.__doc__ is not None:
    360     ginput.__doc__ = dedent(Figure.ginput.__doc__)

/usr/lib/python2.6/dist-packages/matplotlib/figure.pyc in ginput(self, n,
timeout, show_clicks)
   1071         blocking_mouse_input = BlockingMouseInput(self)
   1072         return blocking_mouse_input(n=n, timeout=timeout,
-> 1073                                     show_clicks=show_clicks)
   1074 
   1075     def waitforbuttonpress(self, timeout=-1):

/usr/lib/python2.6/dist-packages/matplotlib/blocking_input.pyc in
__call__(self, n, timeout, show_clicks)
    256         self.clicks      = []
    257         self.marks       = []
--> 258         BlockingInput.__call__(self,n=n,timeout=timeout)
    259 
    260         return self.clicks

/usr/lib/python2.6/dist-packages/matplotlib/blocking_input.pyc in
__call__(self, n, timeout)
    102         try:
    103             # Start event loop

--> 104             self.fig.canvas.start_event_loop(timeout=timeout)
    105         finally: # Run even on exception like ctrl-c
    106             # Disconnect the callbacks


/usr/lib/python2.6/dist-packages/matplotlib/backends/backend_tkagg.pyc in
start_event_loop(self, timeout)
    320 
    321     def start_event_loop(self,timeout):
--> 322         FigureCanvasBase.start_event_loop_default(self,timeout)
    323    
start_event_loop.__doc__=FigureCanvasBase.start_event_loop_default.__doc__
    324 

/usr/lib/python2.6/dist-packages/matplotlib/backend_bases.pyc in
start_event_loop_default(self, timeout)
   1555         str = "Using default event loop until function specific"
   1556         str += " to this GUI is implemented"
-> 1557         warnings.warn(str,DeprecationWarning)
   1558 
   1559         if timeout <= 0: timeout = np.inf

/var/lib/python-support/python2.6/pyfits/NP_pyfits.pyc in
showwarning(message, category, filename, lineno, file)
     74     if file is None:
     75         file = sys.stdout
---> 76     _showwarning(message, category, filename, lineno, file)
     77 
     78 def formatwarning(message, category, filename, lineno):

/usr/lib/python2.6/warnings.pyc in _show_warning(message, category,
filename, lineno, file, line)
     27         file = sys.stderr
     28     try:
---> 29         file.write(formatwarning(message, category, filename,
lineno, line))
     30     except IOError:
     31         pass # the file (probably stderr) is invalid - this warning
gets lost.

TypeError: formatwarning() takes exactly 4 arguments (5 given)



-- 
View this message in context: http://www.nabble.com/ginput%28%29-causes-error-with-TkAgg-and-imshow%28%29-tp23518869p23518869.html
Sent from the Scipy-User mailing list archive at Nabble.com.




More information about the SciPy-User mailing list