#1872 closed defect (fixed)
Internal Error: TclError: bad screen distance "640.0"
Reported by: | Owned by: | Bhuricha Deen Sethanandha | |
---|---|---|---|
Priority: | normal | Component: | TracMetrixPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 0.11 |
Description
After using Tracmetrix I received a error message:
File "f:\programme\python25\lib\site-packages\Trac-0.11dev-py2.5.egg\trac\web\main.py", line 434, in dispatch_request dispatcher.dispatch(req) File "f:\programme\python25\lib\site-packages\Trac-0.11dev-py2.5.egg\trac\web\main.py", line 217, in dispatch resp = chosen_handler.process_request(req) File "build\bdist.win32\egg\tracmetrixplugin\mdashboard.py", line 416, in process_requestFile "build\bdist.win32\egg\tracmetrixplugin\mdashboard.py", line 537, in _render_viewFile "build\bdist.win32\egg\tracmetrixplugin\mdashboard.py", line 287, in create_cummulative_chartFile "F:\Programme\Python25\Lib\site-packages\matplotlib\pylab.py", line 2317, in cla ret = gca().cla(*args, **kwargs) File "F:\Programme\Python25\Lib\site-packages\matplotlib\pylab.py", line 883, in gca ax = gcf().gca(**kwargs) File "F:\Programme\Python25\Lib\site-packages\matplotlib\pylab.py", line 893, in gcf return figure() File "F:\Programme\Python25\Lib\site-packages\matplotlib\pylab.py", line 859, in figure figManager = new_figure_manager(num, figsize=figsize, dpi=dpi, facecolor=facecolor, edgecolor=edgecolor, frameon=frameon, FigureClass=FigureClass, **kwargs) File "F:\Programme\Python25\Lib\site-packages\matplotlib\backends\backend_tkagg.py", line 90, in new_figure_manager figManager = FigureManagerTkAgg(canvas, num, window) File "F:\Programme\Python25\Lib\site-packages\matplotlib\backends\backend_tkagg.py", line 274, in __init__ self.toolbar = NavigationToolbar2TkAgg( canvas, self.window ) File "F:\Programme\Python25\Lib\site-packages\matplotlib\backends\backend_tkagg.py", line 545, in __init__ NavigationToolbar2.__init__(self, canvas) File "F:\Programme\Python25\Lib\site-packages\matplotlib\backend_bases.py", line 1163, in __init__ self._init_toolbar() File "F:\Programme\Python25\Lib\site-packages\matplotlib\backends\backend_tkagg.py", line 585, in _init_toolbar borderwidth=2) File "F:\Programme\Python25\lib\lib-tk\Tkinter.py", line 2442, in __init__ Widget.__init__(self, master, 'frame', cnf, {}, extra) File "F:\Programme\Python25\lib\lib-tk\Tkinter.py", line 1930, in __init__ (widgetName, self._w) + extra + self._options(cnf))
code fragment:
1925. for k in cnf.keys(): 1926. if type(k) is ClassType: 1927. classes.append((k, cnf[k])) 1928. del cnf[k] 1929. self.tk.call( 1930. (widgetName, self._w) + extra + self._options(cnf)) 1931. for k, v in classes: 1932. k.configure(self, v) 1933. def destroy(self): 1934. """Destroy this and all descendants widgets.""" 1935. for c in self.children.values(): c.destroy()
local variables:
classes [] cnf {'width': 640.0, 'borderwidth': 2, 'height': 50} extra () k 'height' kw {} master <Tkinter.Tk instance at 0x027E2C60> self <matplotlib.backends.backend_tkagg.NavigationToolbar2TkAgg instance at ... widgetName 'frame'
Attachments (0)
Change History (9)
comment:1 Changed 17 years ago by
comment:2 Changed 17 years ago by
Sorry! But I cant try to install with python 2.4.4 . I'm using Python 25. But after a reinstall now I have an another error. Looks not so hard.
TclError: bad screen distance "640.0"
What means that?
comment:3 Changed 17 years ago by
Sorry! But there is no time to try to install with python 2.4.4 . I'm using python 2.5
Maybe in my private time.
comment:4 Changed 17 years ago by
didley, thanks for your interest. I will get to this bug once I completed the baseline functionality on Aug 20.
Please also tell me the version of the packages you use. (numpy, matplotlib, gtk) I will try to replicate your configuration and test it.
comment:5 Changed 17 years ago by
hi,
I'm using
- Python 2.5
- Python 2.5 numpy-1.0.3
- Python 2.5 pygtk-2.10.4
- Python 2.5 matplotlib-0.90.1
- Python 2.5 svn-python-1.43
comment:6 Changed 17 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:7 Changed 16 years ago by
Hi!!
I'm getting the same error while running some code. The weird thing it's that I get the error only in some computers, in others works perfect. Even in the same computer, for one user works OK and for another one not.
Some help please, I've spent 2 days running in circles...
comment:8 Changed 15 years ago by
Hi!
I get also the problem of
tkinter.TclError: bad screen distance "320.0"
The error occurs, when I import
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas from matplotlib.figure import Figure from matplotlib.pyplot import imshow
and proceed
imshow(matrix)
after
self.dpi = 100
self.fig = Figure(dpi=self.dpi)
self.canvas = FigureCanvas(self.fig)
I want to use imshow in an QT-Application to have fast look for intensity plots.
Would be great, if anybody could help me!
comment:9 Changed 13 years ago by
Hi,
just for completeness' sake and because this page was the first one Google came up with when searching for that error (and because it drove us nuts for two days): We have observed the same error message ("bad screen distance 640.0") with python 2.7.0, 2.7.1 and 2.7.2 when trying to plot with matplotlib 1.0.1 (all in Windows 64 bit).
The weird thing was that it worked on one machine, but not on the one next to it, which was set up in exactly the same way - or at least we thought so. We found the solution on http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=395867: It turns out the numerical locale was different on the two machines. It worked when the locale was English, but failed for German. I.e., it seems the "640.0" is being converted from a string to float/integer at some point, and that only works in the English numerical locale, where the decimal point is the "." (in German it's the ",").
For us, it worked to manually set the locale just before initializing the matplotlib figure (from the linked bug report):
import locale locale.setlocale(locale.LC_NUMERIC, 'C')
Cheers, JD
Hi,
http://trac-hacks.org/wiki/TracMetrixPlugin#SystemRequirements