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 d229e65

Browse filesBrowse files
committed
Subfigures become stale when their artists are stale
1 parent 0a4385c commit d229e65
Copy full SHA for d229e65

File tree

2 files changed

+4
-2
lines changed
Filter options

2 files changed

+4
-2
lines changed

‎lib/matplotlib/figure.py

Copy file name to clipboardExpand all lines: lib/matplotlib/figure.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@
6464

6565

6666
def _stale_figure_callback(self, val):
67-
if self.figure:
68-
self.figure.stale = val
67+
if (fig := self.get_figure(root=False)) is not None:
68+
fig.stale = val
6969

7070

7171
class _AxesStack:

‎lib/matplotlib/tests/test_figure.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_figure.py
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1777,7 +1777,9 @@ def test_subfigure_stale_propagation():
17771777

17781778
fig.draw_without_rendering()
17791779
assert not fig.stale
1780+
assert not sfig1.stale
17801781
assert not sfig2.stale
17811782

17821783
sfig2.stale = True
1784+
assert sfig1.stale
17831785
assert fig.stale

0 commit comments

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