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

Skip to content

Commit ab1d4f4

Browse files
committed
wx.Bitmap() will complain (at least on MacOS) if width or height is zero
1 parent e8c7579 commit ab1d4f4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/matplotlib/backends/backend_wx.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -694,14 +694,14 @@ def _onSize(self, event):
694694
# no change in size
695695
return
696696
self._width, self._height = size
697-
# Create a new, correctly sized bitmap
698-
self.bitmap = wx.Bitmap(self._width, self._height)
699-
700697
self._isDrawn = False
701698

702699
if self._width <= 1 or self._height <= 1:
703700
return # Empty figure
704701

702+
# Create a new, correctly sized bitmap
703+
self.bitmap = wx.Bitmap(self._width, self._height)
704+
705705
dpival = self.figure.dpi
706706
winch = self._width / dpival
707707
hinch = self._height / dpival

0 commit comments

Comments
 (0)