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 830361d

Browse filesBrowse files
authored
Merge pull request #28540 from rcomer/stale-subfigure-2
Subfigures become stale when their artists are stale
2 parents 0a4385c + 851177f commit 830361d
Copy full SHA for 830361d

File tree

2 files changed

+5
-2
lines changed
Filter options

2 files changed

+5
-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
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1774,10 +1774,13 @@ def test_subfigure_stale_propagation():
17741774

17751775
sfig2 = sfig1.subfigures()
17761776
assert fig.stale
1777+
assert sfig1.stale
17771778

17781779
fig.draw_without_rendering()
17791780
assert not fig.stale
1781+
assert not sfig1.stale
17801782
assert not sfig2.stale
17811783

17821784
sfig2.stale = True
1785+
assert sfig1.stale
17831786
assert fig.stale

0 commit comments

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