Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4d52a3e

Browse filesBrowse files
authored
Merge pull request #24677 from tacaswell/fix/hostaxes_remove
FIX: do not replace the Axes._children list object
2 parents dbf3034 + 0f4ec9a commit 4d52a3e
Copy full SHA for 4d52a3e

File tree

Expand file treeCollapse file tree

2 files changed

+12
-1
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+12
-1
lines changed

‎lib/mpl_toolkits/axes_grid1/parasite_axes.py

Copy file name to clipboardExpand all lines: lib/mpl_toolkits/axes_grid1/parasite_axes.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def draw(self, renderer):
136136
self._children.extend(ax.get_children())
137137

138138
super().draw(renderer)
139-
self._children = self._children[:orig_children_len]
139+
del self._children[orig_children_len:]
140140

141141
def clear(self):
142142
super().clear()

‎lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py

Copy file name to clipboardExpand all lines: lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py
+11Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -684,3 +684,14 @@ def test_imagegrid():
684684
im = ax.imshow([[1, 2]], norm=mpl.colors.LogNorm())
685685
cb = ax.cax.colorbar(im)
686686
assert isinstance(cb.locator, mticker.LogLocator)
687+
688+
689+
def test_removal():
690+
import matplotlib.pyplot as plt
691+
import mpl_toolkits.axisartist as AA
692+
fig = plt.figure()
693+
ax = host_subplot(111, axes_class=AA.Axes, figure=fig)
694+
col = ax.fill_between(range(5), 0, range(5))
695+
fig.canvas.draw()
696+
col.remove()
697+
fig.canvas.draw()

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.