@@ -130,6 +130,7 @@ def isAvailable(self):
130
130
# matplotlib.testing.image_comparison
131
131
@pytest .mark .parametrize ('writer, extension' , WRITER_OUTPUT )
132
132
def test_save_animation_smoketest (tmpdir , writer , extension ):
133
+ mpl .rcParams ['animation.codec' ] = 'h264'
133
134
try :
134
135
# for ImageMagick the rcparams must be patched to account for
135
136
# 'convert' being a built in MS tool, not the imagemagick
@@ -145,6 +146,12 @@ def test_save_animation_smoketest(tmpdir, writer, extension):
145
146
ax .set_xlim (0 , 10 )
146
147
ax .set_ylim (- 1 , 1 )
147
148
149
+ dpi = None
150
+ if writer == 'ffmpeg' :
151
+ # Issue #8253
152
+ fig .set_size_inches ((10.85 , 9.2000000000000011 ))
153
+ dpi = 100.
154
+
148
155
def init ():
149
156
line .set_data ([], [])
150
157
return line ,
@@ -160,7 +167,8 @@ def animate(i):
160
167
with tmpdir .as_cwd ():
161
168
anim = animation .FuncAnimation (fig , animate , init_func = init , frames = 5 )
162
169
try :
163
- anim .save ('movie.' + extension , fps = 30 , writer = writer , bitrate = 500 )
170
+ anim .save ('movie.' + extension , fps = 30 , writer = writer , bitrate = 500 ,
171
+ dpi = dpi )
164
172
except UnicodeDecodeError :
165
173
pytest .xfail ("There can be errors in the numpy import stack, "
166
174
"see issues #1891 and #2679" )
0 commit comments