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

Commit08236ae

Browse files
alphanoobietimhoffmrcomer
authored
Setting imshow(animated=True) still show does not show an image (#30052)
---------Co-authored-by: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>Co-authored-by: Ruth Comer <10599679+rcomer@users.noreply.github.com>
1 parent702c669 commit08236ae

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

‎lib/matplotlib/axes/_base.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3206,7 +3206,7 @@ def draw(self, renderer):
32063206
ifnotself.get_figure(root=True).canvas.is_saving():
32073207
artists= [
32083208
aforainartists
3209-
ifnota.get_animated()orisinstance(a,mimage.AxesImage)]
3209+
ifnota.get_animated()]
32103210
artists=sorted(artists,key=attrgetter('zorder'))
32113211

32123212
# rasterize artists with negative zorder

‎lib/matplotlib/tests/test_axes.py‎

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
importre
1212
importsys
1313
fromtypesimportSimpleNamespace
14+
importunittest.mock
1415

1516
importdateutil.tz
1617

@@ -45,7 +46,6 @@
4546
frommatplotlib.testing.decoratorsimport (
4647
image_comparison,check_figures_equal,remove_ticks_and_titles)
4748
frommatplotlib.testing._markersimportneeds_usetex
48-
4949
# Note: Some test cases are run twice: once normally and once with labeled data
5050
# These two must be defined in the same test function or need to have
5151
# different baseline images to prevent race conditions when pytest runs
@@ -10018,3 +10018,20 @@ def test_pie_all_zeros():
1001810018
fig,ax=plt.subplots()
1001910019
withpytest.raises(ValueError,match="All wedge sizes are zero"):
1002010020
ax.pie([0,0],labels=["A","B"])
10021+
10022+
10023+
deftest_animated_artists_not_drawn_by_default():
10024+
fig, (ax1,ax2)=plt.subplots(ncols=2)
10025+
10026+
imdata=np.random.random((20,20))
10027+
lndata=imdata[0]
10028+
10029+
im=ax1.imshow(imdata,animated=True)
10030+
(ln,)=ax2.plot(lndata,animated=True)
10031+
10032+
with (unittest.mock.patch.object(im,"draw",name="im.draw")asmocked_im_draw,
10033+
unittest.mock.patch.object(ln,"draw",name="ln.draw")asmocked_ln_draw):
10034+
fig.draw_without_rendering()
10035+
10036+
mocked_im_draw.assert_not_called()
10037+
mocked_ln_draw.assert_not_called()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp