FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

FIX: do not replace the Axes._children list object by tacaswell · Pull Request #24677 · matplotlib/matplotlib · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (2) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
2 changes: 1 addition & 1 deletion lib/mpl_toolkits/axes_grid1/parasite_axes.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def draw(self, renderer):
self._children.extend(ax.get_children())

super().draw(renderer)
self._children = self._children[:orig_children_len]
del self._children[orig_children_len:]

def clear(self):
super().clear()
Expand Down
11 changes: 11 additions & 0 deletions lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -684,3 +684,14 @@ def test_imagegrid():
im = ax.imshow([[1, 2]], norm=mpl.colors.LogNorm())
cb = ax.cax.colorbar(im)
assert isinstance(cb.locator, mticker.LogLocator)


def test_removal():
import matplotlib.pyplot as plt
import mpl_toolkits.axisartist as AA
fig = plt.figure()
ax = host_subplot(111, axes_class=AA.Axes, figure=fig)
col = ax.fill_between(range(5), 0, range(5))
fig.canvas.draw()
col.remove()
fig.canvas.draw()

Back | FazBrowse Home | New Git URL