There was an error while loading. Please reload this page.
1 parent d262e53 commit 491c957Copy full SHA for 491c957
1 file changed
lib/matplotlib/backends/backend_wx.py
@@ -922,7 +922,8 @@ def __init__(self, num, fig):
922
_set_frame_icon(self)
923
924
self.canvas = self.get_canvas(fig)
925
- self.canvas.SetInitialSize(wx.Size(fig.bbox.width, fig.bbox.height))
+ w, h = map(math.ceil, fig.bbox.size)
926
+ self.canvas.SetInitialSize(wx.Size(w, h))
927
self.canvas.SetFocus()
928
self.sizer = wx.BoxSizer(wx.VERTICAL)
929
self.sizer.Add(self.canvas, 1, wx.TOP | wx.LEFT | wx.EXPAND)
@@ -1070,7 +1071,8 @@ def set_window_title(self, title):
1070
1071
1072
def resize(self, width, height):
1073
# docstring inherited
- self.canvas.SetInitialSize(wx.Size(width, height))
1074
+ self.canvas.SetInitialSize(
1075
+ wx.Size(math.ceil(width), math.ceil(height)))
1076
self.window.GetSizer().Fit(self.window)
1077
1078
0 commit comments