Closed
Description
Bug report
Bug summary
Getting AttributeError Messages when activating zooming or panning in the toolbar.
Moving the mouse cursor over the axes writes the AttributeError message to the console. The same message can be generated by e.g. print(cavas.manager)
# -*- coding: utf-8 -*-
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2Tk
import tkinter as tk
root = tk.Tk()
fig, ax = plt.subplots(1, dpi=72, )
canvas = FigureCanvasTkAgg(fig, master=root)
print(matplotlib.get_backend())
print(canvas.manager) # get the error without zooming
canvas.get_tk_widget().pack(side="top", fill='both', expand=True)
canvas.draw()
toolbar = NavigationToolbar2Tk(canvas, root)
toolbar.update()
toolbar.pack(side="left")
root.mainloop()
Actual outcome
Qt5Agg
Traceback (most recent call last):
File "D:\MyApps\Python\QSYS_Reporter\tktest.py", line 14, in <module>
print(canvas.manager) # get the error without zooming
AttributeError: 'FigureCanvasTkAgg' object has no attribute 'manager'
>>>
Expected outcome
Matplotlib version
- Operating system: Windows 7
- Matplotlib version: 3.1.0 works with 2.0.2 Python 3.6.1 on my linux machine (using NavigationToolbar2TkAgg instead of NavigationToolbar2Tk)
- Matplotlib backend (
print(matplotlib.get_backend())
): Qt5Agg, (Same with TkAgg explicitly set.) - Python version: 3.7.3
- Jupyter version (if applicable):
- Other libraries:
Ananconda installation file Anaconda3-2019.03-Windows-x86_64.exe