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.
By clicking “Sign up for GitHub”, you agree to our
terms of service
and
privacy statement
. We’ll occasionally send you account related emails.
Already on GitHub?
Sign in
to your account
Traceback (most recent call last):
File "C:\Users\cyrieln\AppData\Local\Programs\Python\Python36\lib\site-packages\matplotlib\backend_bases.py", line 2785, in _wait_cursor_for_draw_cm
self.set_cursor(cursors.WAIT)
File "C:\Users\cyrieln\AppData\Local\Programs\Python\Python36\lib\site-packages\matplotlib\backends\_backend_tk.py", line 544, in set_cursor
window.configure(cursor=cursord[cursor])
File "C:\Users\cyrieln\AppData\Local\Programs\Python\Python36\lib\tkinter\__init__.py", line 1485, in configure
return self._configure('configure', cnf, kw)
File "C:\Users\cyrieln\AppData\Local\Programs\Python\Python36\lib\tkinter\__init__.py", line 1476, in _configure
self.tk.call(_flatten((self._w, cmd)) + self._options(cnf))
_tkinter.TclError: invalid command name "."
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:/Users/cyrieln/workspaces/LandingSim/src/AdnLandingSim3d/dev/test.py", line 17, in <module>
fig.savefig('test.png')
File "C:\Users\cyrieln\AppData\Local\Programs\Python\Python36\lib\site-packages\matplotlib\figure.py", line 2203, in savefig
self.canvas.print_figure(fname, **kwargs)
File "C:\Users\cyrieln\AppData\Local\Programs\Python\Python36\lib\site-packages\matplotlib\backend_bases.py", line 2105, in print_figure
**kwargs)
File "C:\Users\cyrieln\AppData\Local\Programs\Python\Python36\lib\site-packages\matplotlib\backends\backend_agg.py", line 514, in print_png
FigureCanvasAgg.draw(self)
File "C:\Users\cyrieln\AppData\Local\Programs\Python\Python36\lib\site-packages\matplotlib\backends\backend_agg.py", line 392, in draw
else nullcontext()):
File "C:\Users\cyrieln\AppData\Local\Programs\Python\Python36\lib\contextlib.py", line 81, in __enter__
return next(self.gen)
File "C:\Users\cyrieln\AppData\Local\Programs\Python\Python36\lib\site-packages\matplotlib\backend_bases.py", line 2788, in _wait_cursor_for_draw_cm
self.set_cursor(self._lastCursor)
File "C:\Users\cyrieln\AppData\Local\Programs\Python\Python36\lib\site-packages\matplotlib\backends\_backend_tk.py", line 544, in set_cursor
window.configure(cursor=cursord[cursor])
File "C:\Users\cyrieln\AppData\Local\Programs\Python\Python36\lib\tkinter\__init__.py", line 1485, in configure
return self._configure('configure', cnf, kw)
File "C:\Users\cyrieln\AppData\Local\Programs\Python\Python36\lib\tkinter\__init__.py", line 1476, in _configure
self.tk.call(_flatten((self._w, cmd)) + self._options(cnf))
_tkinter.TclError: invalid command name "."
Process finished with exit code 1
Matplotlib version
Operating system: Win10
Matplotlib version: 3.2.1
Matplotlib backend TkAgg
Python version: 3.7
This seems to work:
diff --git a/lib/matplotlib/backends/_backend_tk.py b/lib/matplotlib/backends/_backend_tk.py
index 5ad469820..da0bd60d5 100644
--- a/lib/matplotlib/backends/_backend_tk.py
+++ b/lib/matplotlib/backends/_backend_tk.py
@@ -541,8 +545,12 @@ class NavigationToolbar2Tk(NavigationToolbar2, tk.Frame):
def set_cursor(self, cursor):
window = self.canvas.get_tk_widget().master
- window.configure(cursor=cursord[cursor])
- window.update_idletasks()
+ try:
+ window.configure(cursor=cursord[cursor])
+ except tkinter.TclError:
+ pass
+ else:
+ window.update_idletasks()
def _Button(self, text, image_file, toggle, command):
image = (tk.PhotoImage(master=self, file=image_file)