You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An unhandled Done exception can occur in the wxagg backend. In the example below, the code can continue running, although some additional action is required to draw the figure as the plot is initially blank.
Traceback (most recent call last):
File "C:\Python39-64\lib\site-packages\matplotlib\backends\backend_wx.py", line 653, in _onPaint
self.draw(drawDC=drawDC)
File "C:\Python39-64\lib\site-packages\matplotlib\backends\backend_wxagg.py", line 29, in draw
FigureCanvasAgg.draw(self)
File "C:\Python39-64\lib\site-packages\matplotlib\backends\backend_agg.py", line 436, in draw
self.figure.draw(self.renderer)
File "C:\Python39-64\lib\site-packages\matplotlib\backend_bases.py", line 1533, in _draw
def _draw(renderer): raise Done(renderer)
matplotlib.backend_bases._get_renderer..Done: <matplotlib.backends.backend_agg.RendererAgg object at 0x000002022EF5D250>
Expected outcome
The exception is caught somewhere or does not occur.
Additional information
I believe this only occurs in matplotlib version 3.5.0. This is with wxPython version 4.1.1.
It looks like figure.tight_layout() calls _get_renderer() which, in this example, subsequently calls _FigureCanvasWxBase.set_cursor(). Changing the self.Update() call in set_cursor() to self.Refresh() will allow the cbook._setattr_cm from _get_renderer() to exit prior to the paint event and avoid the exception. However, I'm not sure what the intended behavior is. Should a function call to get the renderer trigger a cursor change?
Operating system
Windows 10, 64-bit
Matplotlib Version
3.5.0
Matplotlib Backend
wxagg
Python version
3.9.9
Jupyter version
N/A
Installation
pip
The text was updated successfully, but these errors were encountered:
I can confirm the issue and your interpretation. The bug only occurs on Windows, which may be why the bug was previously missed. Switch Update() to Refresh() also seems reasonable.
Bug summary
An unhandled Done exception can occur in the wxagg backend. In the example below, the code can continue running, although some additional action is required to draw the figure as the plot is initially blank.
Code for reproduction
Actual outcome
Traceback (most recent call last):
File "C:\Python39-64\lib\site-packages\matplotlib\backends\backend_wx.py", line 653, in _onPaint
self.draw(drawDC=drawDC)
File "C:\Python39-64\lib\site-packages\matplotlib\backends\backend_wxagg.py", line 29, in draw
FigureCanvasAgg.draw(self)
File "C:\Python39-64\lib\site-packages\matplotlib\backends\backend_agg.py", line 436, in draw
self.figure.draw(self.renderer)
File "C:\Python39-64\lib\site-packages\matplotlib\backend_bases.py", line 1533, in _draw
def _draw(renderer): raise Done(renderer)
matplotlib.backend_bases._get_renderer..Done: <matplotlib.backends.backend_agg.RendererAgg object at 0x000002022EF5D250>
Expected outcome
The exception is caught somewhere or does not occur.
Additional information
I believe this only occurs in matplotlib version 3.5.0. This is with wxPython version 4.1.1.
It looks like figure.tight_layout() calls _get_renderer() which, in this example, subsequently calls _FigureCanvasWxBase.set_cursor(). Changing the self.Update() call in set_cursor() to self.Refresh() will allow the cbook._setattr_cm from _get_renderer() to exit prior to the paint event and avoid the exception. However, I'm not sure what the intended behavior is. Should a function call to get the renderer trigger a cursor change?
Operating system
Windows 10, 64-bit
Matplotlib Version
3.5.0
Matplotlib Backend
wxagg
Python version
3.9.9
Jupyter version
N/A
Installation
pip
The text was updated successfully, but these errors were encountered: