8000 Backport PR #22806: FIX: callback for subfigure uses parent · matplotlib/matplotlib@f399844 · GitHub
[go: up one dir, main page]

Skip to content

Commit f399844

Browse files
greglucasmeeseeksmachine
authored andcommitted
Backport PR #22806: FIX: callback for subfigure uses parent
1 parent c661729 commit f399844

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
@@ -946,7 +946,6 @@ def clear(self, keep_observers=False):
946946
a gui widget is tracking the Axes in the figure.
947947
"""
948948
self.suppressComposite = None
949-
self.callbacks = cbook.CallbackRegistry()
950949

951950
# first clear the axes in any subfigures
952951
for subfig in self.subfigs:
@@ -2051,6 +2050,8 @@ def __init__(self, parent, subplotspec, *,
20512050
self._subplotspec = subplotspec
20522051
self._parent = parent
20532052
self.figure = parent.figure
2053+
self.callbacks = parent.callbacks
2054+
20542055
# subfigures use the parent axstack
20552056
self._axstack = parent._axstack
20562057
self.subplotpars = parent.subplotpars

0 commit comments

Comments
 (0)
0