Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0e543d6

Browse files
committed
Merged revisions 5211,5213 via svnmerge from
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_91_maint ........ r5211 | mdboom | 2008-05-21 08:06:51 -0500 (Wed, 21 May 2008) | 2 lines Backport TkAgg segfault fix. ........ r5213 | jdh2358 | 2008-05-22 09:21:10 -0500 (Thu, 22 May 2008) | 1 line applied stans wx figsize patch ........ svn path=/trunk/matplotlib/; revision=5214
1 parent 20f2561 commit 0e543d6

3 files changed

Lines changed: 11 additions & 2 deletions

File tree

CHANGELOG

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
2008-05-21 Fix segfault in TkAgg backend - MGD
2+
13
2008-05-21 Fix a "local variable unreferenced" bug in plotfile - MM
24

35
2008-05-19 Fix crash when Windows can not access the registry to

lib/matplotlib/backends/backend_wx.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1226,14 +1226,15 @@ def __init__(self, num, fig):
12261226
pos =wx.Point(20,20)
12271227
l,b,w,h = fig.bbox.bounds
12281228
wx.Frame.__init__(self, parent=None, id=-1, pos=pos,
1229-
title="Figure %d" % num,
1230-
size=(w,h))
1229+
title="Figure %d" % num)
1230+
# Frame will be sized later by the Fit method
12311231
DEBUG_MSG("__init__()", 1, self)
12321232
self.num = num
12331233

12341234
statbar = StatusBarWx(self)
12351235
self.SetStatusBar(statbar)
12361236
self.canvas = self.get_canvas(fig)
1237+
self.canvas.SetInitialSize(wx.Size(fig.bbox.width(), fig.bbox.height()))
12371238
self.sizer =wx.BoxSizer(wx.VERTICAL)
12381239
self.sizer.Add(self.canvas, 1, wx.TOP | wx.LEFT | wx.EXPAND)
12391240
# By adding toolbar in sizer, we are able to put it at the bottom
@@ -1352,6 +1353,11 @@ def destroy(self, *args):
13521353
def set_window_title(self, title):
13531354
self.window.SetTitle(title)
13541355

1356+
def resize(self, width, height)
1357+
'Set the canvas size in pixels'
1358+
self.canvas.SetInitialSize(wx.Size(width, height))
1359+
self.window.GetSizer().Fit(self.window)
1360+
13551361
# Identifiers for toolbar controls - images_wx contains bitmaps for the images
13561362
# used in the controls. wxWindows does not provide any stock images, so I've
13571363
# 'stolen' those from GTK2, and transformed them into the appropriate format.

lib/matplotlib/figure.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,7 @@ def set_size_inches(self, *args, **kwargs):
414414
from the shell
415415
416416
WARNING: forward=True is broken on all backends except GTK*
417+
and WX*
417418
418419
ACCEPTS: a w,h tuple with w,h in inches
419420
"""

0 commit comments

Comments
 (0)