8000 Merge pull request #22806 from jklymak/fix-subfigure-callbacks · matplotlib/matplotlib@5937c68 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5937c68

Browse files
authored
Merge pull request #22806 from jklymak/fix-subfigure-callbacks
FIX: callback for subfigure uses parent
2 parents 28cebd4 + 5b0d225 commit 5937c68

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/matplotlib/figure.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,6 @@ def clear(self, keep_observers=False):
924924
a gui widget is tracking the Axes in the figure.
925925
"""
926926
self.suppressComposite = None
927-
self.callbacks = cbook.CallbackRegistry()
928927

929928
# first clear the axes in any subfigures
930929
for subfig in self.subfigs:
@@ -2025,6 +2024,8 @@ def __init__(self, parent, subplotspec, *,
20252024
self._subplotspec = subplotspec
20262025
self._parent = parent
20272026
self.figure = parent.figure
2027+
self.callbacks = parent.callbacks
2028+
20282029
# subfigures use the parent axstack
20292030
self._axstack = parent._axstack
20302031
self.subplotpars = parent.subplotpars

0 commit comments

Comments
 (0)
0