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

Skip to content

Commit 370d2c8

Browse files
Remove _children_by_layer initialization from FigureBase
1 parent 6e899bd commit 370d2c8

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

lib/matplotlib/figure.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,9 +209,6 @@ def __init__(self, **kwargs):
209209
self._localaxes = [] # track all Axes
210210
self.subfigs = []
211211
self._children = [] # All artists except SubFigure and Axes
212-
self._children_by_layer = {"base": self._children}
213-
# Note: "patch" layer is added by Figure/SubFigure.__init__ after
214-
# self.patch is created, since FigureBase has no self.patch of its own.
215212
self.stale = True
216213
self.suppressComposite = None
217214
self.set(**kwargs)
@@ -2440,7 +2437,10 @@ def __init__(self, parent, subplotspec, *,
24402437
self.patch.set_antialiased(False)
24412438
# Rebuild the dict with "patch" as the first key so that iterating
24422439
# _children_by_layer in insertion order always draws patch first.
2443-
self._children_by_layer = {"patch": [self.patch], **self._children_by_layer}
2440+
self._children_by_layer = {
2441+
"patch": [self.patch],
2442+
"base": self._children,
2443+
}
24442444

24452445
@property
24462446
def canvas(self):

0 commit comments

Comments
 (0)