Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commit6afbad4

Browse files
QuLogictacaswell
authored andcommitted
Backport PRmatplotlib#17602: FIX: propagate _is_saving state when changing canvases
Merge pull requestmatplotlib#17602 from tacaswell/fix_mixed_canvas_animation_saveFIX: propagate _is_saving state when changing canvasesConflicts:lib/matplotlib/backend_bases.py - other nearby changes, only backport the context manager related changeslib/matplotlib/tests/test_figure.py - did not backport the other tests that are currently only on master branch.
1 parent889c73f commit6afbad4

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

‎lib/matplotlib/backend_bases.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2068,8 +2068,9 @@ def print_figure(self, filename, dpi=None, facecolor=None, edgecolor=None,
20682068
# Some code (e.g. Figure.show) differentiates between having *no*
20692069
# manager and a *None* manager, which should be fixed at some point,
20702070
# but this should be fine.
2071-
withcbook._setattr_cm(self,_is_saving=True,manager=None), \
2072-
cbook._setattr_cm(self.figure,dpi=dpi):
2071+
withcbook._setattr_cm(self,manager=None), \
2072+
cbook._setattr_cm(self.figure,dpi=dpi), \
2073+
cbook._setattr_cm(canvas,_is_saving=True):
20732074

20742075
iffacecolorisNone:
20752076
facecolor=rcParams['savefig.facecolor']

‎lib/matplotlib/tests/test_figure.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,3 +487,12 @@ def test_removed_axis():
487487
fig,axs=plt.subplots(2,sharex=True)
488488
axs[0].remove()
489489
fig.canvas.draw()
490+
491+
492+
@check_figures_equal(extensions=["svg","pdf","eps","png"])
493+
deftest_animated_with_canvas_change(fig_test,fig_ref):
494+
ax_ref=fig_ref.subplots()
495+
ax_ref.plot(range(5))
496+
497+
ax_test=fig_test.subplots()
498+
ax_test.plot(range(5),animated=True)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp