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

Skip to content

Commit cfc4229

Browse files
authored
Merge pull request #18545 from meeseeksmachine/auto-backport-of-pr-18540-on-v3.3.x
Backport PR #18540 on branch v3.3.x (Call to ExitStack.push should have been ExitStack.callback.)
2 parents c18921a + 078ee94 commit cfc4229

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

lib/matplotlib/axes/_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2774,7 +2774,7 @@ def redraw_in_frame(self):
27742774
with ExitStack() as stack:
27752775
for artist in [*self._get_axis_list(),
27762776
self.title, self._left_title, self._right_title]:
2777-
stack.push(artist.set_visible, artist.get_visible())
2777+
stack.callback(artist.set_visible, artist.get_visible())
27782778
artist.set_visible(False)
27792779
self.draw(self.figure._cachedRenderer)
27802780

lib/matplotlib/tests/test_axes.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6350,6 +6350,13 @@ def test_bbox_aspect_axes_init():
63506350
assert_allclose(sizes, sizes[0])
63516351

63526352

6353+
def test_redraw_in_frame():
6354+
fig, ax = plt.subplots(1, 1)
6355+
ax.plot([1, 2, 3])
6356+
fig.canvas.draw()
6357+
ax.redraw_in_frame()
6358+
6359+
63536360
def test_invisible_axes():
63546361
# invisible axes should not respond to events...
63556362
fig, ax = plt.subplots()

0 commit comments

Comments
 (0)