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 beacf38

Browse filesBrowse files
authored
Merge pull request #18540 from radarsat1/fix-redraw-in-frame
Call to ExitStack.push should have been ExitStack.callback.
2 parents 8fa61a4 + a5d532e commit beacf38
Copy full SHA for beacf38

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
@@ -2845,7 +2845,7 @@ def redraw_in_frame(self):
28452845
with ExitStack() as stack:
28462846
for artist in [*self._get_axis_list(),
28472847
self.title, self._left_title, self._right_title]:
2848-
stack.push(artist.set_visible, artist.get_visible())
2848+
stack.callback(artist.set_visible, artist.get_visible())
28492849
artist.set_visible(False)
28502850
self.draw(self.figure._cachedRenderer)
28512851

‎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.