Repository navigation
Closed
Labels
Milestone
Description
Bug summary
The Tool Manager example doesn't work.
Code for reproduction
python toolmanager_sgskip.pyActual outcome
-
Tools are not added:
matplotlib/examples/user_interfaces/toolmanager_sgskip.py
Lines 77 to 78 in 0c1aa86
fig.canvas.manager.toolmanager.add_tool('List', ListTools) fig.canvas.manager.toolmanager.add_tool('Show', GroupHideTool, gid='mygroup')
Traceback (most recent call last):
File "C:\Programs\Python38\lib\site-packages\matplotlib\backends\backend_qt.py", line 930, in handler
self.trigger_tool(name)
File "C:\Programs\Python38\lib\site-packages\matplotlib\backend_bases.py", line 3391, in trigger_tool
self.toolmanager.trigger_tool(name, sender=self)
File "C:\Programs\Python38\lib\site-packages\matplotlib\backend_managers.py", line 379, in trigger_tool
self._trigger_tool(name, sender, canvasevent, data)
File "C:\Programs\Python38\lib\site-packages\matplotlib\backend_managers.py", line 394, in _trigger_tool
tool.trigger(sender, canvasevent, data)
File "C:\Programs\Python38\lib\site-packages\matplotlib\backends\backend_qt.py", line 970, in trigger
NavigationToolbar2QT.configure_subplots(
File "C:\Programs\Python38\lib\site-packages\matplotlib\backends\backend_qt.py", line 753, in configure_subplots
if self._subplot_dialog is None:
AttributeError: 'types.SimpleNamespace' object has no attribute '_subplot_dialog'
Expected outcome
- tools being added
- no crash
Additional information
No response
Operating system
No response
Matplotlib Version
3.5.1
Matplotlib Backend
No response
Python version
No response
Jupyter version
No response
Installation
No response

Activity
anntzer commentedon Jan 3, 2022
Good catch, this is likely a regression from #21681 (3.5.1, so labeling the fix as 3.5.2), something like
(moving instance tracking to SubplotToolQt itself) would be one way to fix this.
StefRe commentedon Jan 3, 2022
@anntzer Thanks for the super fast reply 👍 .
When using the Tk backend (added
plt.matplotlib.use('tkagg')) there's another issue: the "Configure subplots" dialog works at first but then freezes: open the dialog and move some sliders - after a short while the dialog freezes (python 3.8.2 64bit Windows). I guess I should open a separate issue for this, shouldn't I?anntzer commentedon Jan 3, 2022
Please do (I don't have a solution for that off the top of my head).
TheRikke commentedon Mar 4, 2022
I have the same issue and can confirm that the patch fixed it.
Fix configure_subplots with tool manager
Fix configure_subplots with tool manager