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

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib/matplotlib/axes/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1298,9 +1298,11 @@ def __clear(self):
self._get_patches_for_fill = _process_plot_var_args('fill')

self._gridOn = mpl.rcParams['axes.grid']
old_children, self._children = self._children, []
for chld in old_children:
for chld in self._children:
chld.axes = chld._parent_figure = None
# Use list.clear instead of setting _children to empty list to
# break the `artist._remove_method` reference cycle
self._children.clear()
self._mouseover_set = _OrderedSet()
self.child_axes = []
self._current_image = None # strictly for pyplot via _sci, _gci
Expand Down