From ab1d4f48ee92630bcebab68e4b5ca911737dd78e Mon Sep 17 00:00:00 2001 From: Matthew Newville Date: Wed, 29 Apr 2020 12:51:42 -0500 Subject: [PATCH] wx.Bitmap() will complain (at least on MacOS) if width or height is zero --- lib/matplotlib/backends/backend_wx.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/matplotlib/backends/backend_wx.py b/lib/matplotlib/backends/backend_wx.py index 0078c97ac35d..176fe34fa77a 100644 --- a/lib/matplotlib/backends/backend_wx.py +++ b/lib/matplotlib/backends/backend_wx.py @@ -694,14 +694,14 @@ def _onSize(self, event): # no change in size return self._width, self._height = size - # Create a new, correctly sized bitmap - self.bitmap = wx.Bitmap(self._width, self._height) - self._isDrawn = False if self._width <= 1 or self._height <= 1: return # Empty figure + # Create a new, correctly sized bitmap + self.bitmap = wx.Bitmap(self._width, self._height) + dpival = self.figure.dpi winch = self._width / dpival hinch = self._height / dpival