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

Skip to content

Commit f27a7f3

Browse files
authored
Merge pull request #16304 from anntzer/legend-children
MNT: Simplify Legend.get_children.
2 parents 3ee0219 + 6e04afc commit f27a7f3

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

lib/matplotlib/legend.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -865,13 +865,8 @@ def _auto_legend_data(self):
865865
return [vertices, bboxes, lines, offsets]
866866

867867
def get_children(self):
868-
"""Return the list of child artists."""
869-
children = []
870-
if self._legend_box:
871-
children.append(self._legend_box)
872-
children.append(self.get_frame())
873-
874-
return children
868+
# docstring inherited
869+
return [self._legend_box, self.get_frame()]
875870

876871
def get_frame(self):
877872
"""Return the `~.patches.Rectangle` used to frame the legend."""

0 commit comments

Comments
 (0)