FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Wait cursor may cause Tk to print _get_renderer.Done backtrace · Issue #18186 · matplotlib/matplotlib · GitHub

Repository navigation

Wait cursor may cause Tk to print _get_renderer.Done backtrace #18186

Closed

Description

Bug report

Bug summary

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.

Code for reproduction

See #11769.

Actual outcome

../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>

Expected outcome

No backtrace printed.

Matplotlib version

  • Operating system: Fedora 31
  • Matplotlib version: master 52761de
  • Matplotlib backend (print(matplotlib.get_backend())): TkAgg
  • Python version: 3.7.6

Activity

  1. QuLogic commented on Aug 5, 2020

    MemberAuthor

    Since this is apparently caused by the window.update_idletasks() in NavigationToolbar2Tk.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.

  2. richardsheridan commented on Aug 10, 2020

    Contributor

    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...

  3. anntzer commented on May 11, 2021

    Contributor

    This has been fixed on master; I haven't bisected but did so for the similar #20204: likely this was indeed fixed by #17789.

  4. added this to the v3.4.0 milestone on May 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL