Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f61ac07

Browse files
keep a reference to the output of subplot_tool to preserve callback weakrefs
1 parent 7c48cbd commit f61ac07

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/backend_bases.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3294,8 +3294,8 @@ def _update_view(self):
32943294

32953295
def configure_subplots(self, *args):
32963296
plt = _safe_pyplot_import()
3297-
tool = plt.subplot_tool(self.canvas.figure)
3298-
tool.figure.canvas.manager.show()
3297+
self.subplot_tool = plt.subplot_tool(self.canvas.figure)
3298+
self.subplot_tool.figure.canvas.manager.show()
32993299

33003300
def save_figure(self, *args):
33013301
"""Save the current figure."""

0 commit comments

Comments
 (0)