8000 fixed wx 2.5 figsize bug · matplotlib/matplotlib@6a47b93 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6a47b93

Browse files
committed
fixed wx 2.5 figsize bug
svn path=/trunk/matplotlib/; revision=1164
1 parent f6b5c0a commit 6a47b93

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

examples/embedding_in_wx4.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ def __init__(self):
104104

105105
def OnPaint(self, event):
106106
self.canvas.draw()
107+
event.Skip()
107108

108109
class App(wxApp):
109110

lib/matplotlib/__init__.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@
142142
"""
143143
from __future__ import generators
144144

145-
__version__ = '0.74'
145+
__version__ = '0.80'
146146
__revision__ = '$Revision$'
147147
__date__ = '$Date$'
148148

@@ -307,9 +307,15 @@ def _get_data_path():
307307
# C:\Python23\share\matplotlib into your dist dir. See
308308
# http://starship.python.net/crew/theller/moin.cgi/MatPlotLib
309309
# for more info
310-
if sys.platform=='win32' and sys.frozen:
311-
path = os.path.join(os.path.split(sys.path[0])[0], 'matplotlibdata')
312-
return path
310+
311+
if sys.platform=='win32' and sys.frozen:
312+
path = os.path.join(os.path.split(sys.path[0])[0], 'matplotlibdata')
313+
if os.path.isdir(path): return path
314+
else:
315+
# Try again assuming sys.path[0] is a dir not a exe
316+
path = os.path.join(sys.path[0], 'matplotlibdata')
317+
if os.path.isdir(path): return path
318+
313319
raise RuntimeError('Could not find the matplotlib data files')
314320

315321
get_data_path = verbose.wrap('matplotlib data path %s', _get_data_path, always=False)

lib/matplotlib/backends/backend_wx.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1216,8 +1216,10 @@ def __init__(self, num, fig):
12161216
pos = wx.DefaultPosition
12171217
else:
12181218
pos =wx.Point(20,20)
1219+
l,b,w,h = fig.bbox.get_bounds()
12191220
wx.Frame.__init__(self, parent=None, id=-1, pos=pos,
1220-
title="Figure %d" % num)
1221+
title="Figure %d" % num,
1222+
size=(w,h))
12211223
DEBUG_MSG("__init__()", 1, self)
12221224
self.num = num
12231225

0 commit comments

Comments
 (0)
0