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 a5d532e

Browse filesBrowse files
committed
Call to ExitStack.push should have been ExitStack.callback.
In Axes.redraw_in_frame(). Fixes #18539.
1 parent 1e19aa8 commit a5d532e
Copy full SHA for a5d532e

File tree

Expand file treeCollapse file tree

2 files changed

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

2 files changed

+8
-1
lines changed

‎lib/matplotlib/axes/_base.py

Copy file name to clipboardExpand all lines: lib/matplotlib/axes/_base.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2828,7 +2828,7 @@ def redraw_in_frame(self):
28282828
with ExitStack() as stack:
28292829
for artist in [*self._get_axis_list(),
28302830
self.title, self._left_title, self._right_title]:
2831-
stack.push(artist.set_visible, artist.get_visible())
2831+
stack.callback(artist.set_visible, artist.get_visible())
28322832
artist.set_visible(False)
28332833
self.draw(self.figure._cachedRenderer)
28342834

‎lib/matplotlib/tests/test_axes.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_axes.py
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6612,6 +6612,13 @@ def test_bbox_aspect_axes_init():
66126612
assert_allclose(sizes, sizes[0])
66136613

66146614

6615+
def test_redraw_in_frame():
6616+
fig, ax = plt.subplots(1, 1)
6617+
ax.plot([1, 2, 3])
6618+
fig.canvas.draw()
6619+
ax.redraw_in_frame()
6620+
6621+
66156622
def test_invisible_axes():
66166623
# invisible axes should not respond to events...
66176624
fig, ax = plt.subplots()

0 commit comments

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