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

Skip to content

Subfigures become stale when their artists are stale #28540

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/matplotlib/figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@


def _stale_figure_callback(self, val):
if self.figure:
self.figure.stale = val
if (fig := self.get_figure(root=False)) is not None:
fig.stale = val


class _AxesStack:
Expand Down
3 changes: 3 additions & 0 deletions lib/matplotlib/tests/test_figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -1774,10 +1774,13 @@ def test_subfigure_stale_propagation():

sfig2 = sfig1.subfigures()
assert fig.stale
assert sfig1.stale

fig.draw_without_rendering()
assert not fig.stale
assert not sfig1.stale
assert not sfig2.stale

sfig2.stale = True
assert sfig1.stale
assert fig.stale
Loading