We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents ce21d72 + 35b947a commit 5eb3988Copy full SHA for 5eb3988
lib/matplotlib/backend_bases.py
@@ -3367,10 +3367,14 @@ def configure_subplots(self, *args):
3367
tool_fig = manager.canvas.figure
3368
tool_fig.subplots_adjust(top=0.9)
3369
self.subplot_tool = widgets.SubplotTool(self.canvas.figure, tool_fig)
3370
- tool_fig.canvas.mpl_connect(
3371
- "close_event", lambda e: delattr(self, "subplot_tool"))
3372
- self.canvas.mpl_connect(
+ cid = self.canvas.mpl_connect(
3373
"close_event", lambda e: manager.destroy())
+
+ def on_tool_fig_close(e):
3374
+ self.canvas.mpl_disconnect(cid)
3375
+ del self.subplot_tool
3376
3377
+ tool_fig.canvas.mpl_connect("close_event", on_tool_fig_close)
3378
manager.show()
3379
return self.subplot_tool
3380
0 commit comments