Thanks to visit codestin.com Credit goes to github.com
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 8e420f8 + 613845b commit 0bafdf2Copy full SHA for 0bafdf2
lib/matplotlib/backend_bases.py
@@ -3357,10 +3357,14 @@ def configure_subplots(self, *args):
3357
tool_fig = manager.canvas.figure
3358
tool_fig.subplots_adjust(top=0.9)
3359
self.subplot_tool = widgets.SubplotTool(self.canvas.figure, tool_fig)
3360
- tool_fig.canvas.mpl_connect(
3361
- "close_event", lambda e: delattr(self, "subplot_tool"))
3362
- self.canvas.mpl_connect(
+ cid = self.canvas.mpl_connect(
3363
"close_event", lambda e: manager.destroy())
+
+ def on_tool_fig_close(e):
3364
+ self.canvas.mpl_disconnect(cid)
3365
+ del self.subplot_tool
3366
3367
+ tool_fig.canvas.mpl_connect("close_event", on_tool_fig_close)
3368
manager.show()
3369
return self.subplot_tool
3370
0 commit comments