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
{{ message }}
Repository navigation
Wait cursor may cause Tk to print _get_renderer.Done backtrace #18186
I was looking at #11769, and apparently Gouraud shading was slow enough to trigger the wait cursor on the third figure. This printed out a backtrace, though the figures seems to be saved just fine.
../mpl-tests/issue11769.py:23: MatplotlibDeprecationWarning: shading='flat' when X and Y have the same dimensions as C is deprecated since 3.3. Either specify the corners of the quadrilaterals with X and Y, or pass shading='auto', 'nearest' or 'gouraud', or set rcParams['pcolor.shading']. This will become an error two minor releases later.
plt.pcolormesh(x,y,map2,cmap='viridis',vmin=np.nanmin(map2),vmax=np.nanmax(map2))
Exception in Tkinter callback
Traceback (most recent call last):
File "/var/container/conda/envs/mpl37/lib/python3.7/tkinter/__init__.py", line 1705, in __call__
return self.func(*args)
File "/var/container/conda/envs/mpl37/lib/python3.7/tkinter/__init__.py", line 749, in callit
func(*args)
File ".../matplotlib/lib/matplotlib/backends/_backend_tk.py", line 247, in idle_draw
self.draw()
File ".../matplotlib/lib/matplotlib/backends/backend_tkagg.py", line 9, in draw
super().draw()
File ".../matplotlib/lib/matplotlib/backends/backend_agg.py", line 409, in draw
self.figure.draw(self.renderer)
File ".../matplotlib/lib/matplotlib/backend_bases.py", line 1546, in _draw
def _draw(renderer): raise Done(renderer)
matplotlib.backend_bases._get_renderer.<locals>.Done: <matplotlib.backends.backend_agg.RendererAgg object at 0x7f45c8946290>
If any of the code between lines 1549-1557 calls window.update_idletasks(), and one of the idle tasks happens to be draw_idle(), then it will try to call canvas.draw() while cbook._setattr_cm(figure, draw=_draw) is still active, but it won't be affected by the try block! Another great reason never to use window.update() and friends in library code...
Activity
QuLogic commentedon Aug 5, 2020
Since this is apparently caused by the
window.update_idletasks()inNavigationToolbar2Tk.set_cursor, I guess this would be fixed by #17789.Though I'm not sure how Tk manages to see this exception since it's supposed to be caught right there.
richardsheridan commentedon Aug 10, 2020
If any of the code between lines 1549-1557 calls
window.update_idletasks(), and one of the idle tasks happens to bedraw_idle(), then it will try to callcanvas.draw()whilecbook._setattr_cm(figure, draw=_draw)is still active, but it won't be affected by thetryblock! Another great reason never to usewindow.update()and friends in library code...anntzer commentedon May 11, 2021
This has been fixed on master; I haven't bisected but did so for the similar #20204: likely this was indeed fixed by #17789.