Skip to content

Commit 187e87b

Browse files
authored
Merge pull request #17909 from bmcfee/anim-formats-params
frame_format to support all listed by animation writers
2 parents deb788d + e0f074e commit 187e87b

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

lib/matplotlib/rcsetup.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,8 @@ def validate_movie_writer(s):
751751

752752

753753
validate_movie_frame_fmt = ValidateInStrings(
754-
'animation.frame_format', ['png', 'jpeg', 'tiff', 'raw', 'rgba'],
754+
'animation.frame_format', ['png', 'jpeg', 'tiff', 'raw', 'rgba', 'ppm',
755+
'sgi', 'bmp', 'pbm', 'svg'],
755756
_deprecated_since="3.3")
756757
validate_axis_locator = ValidateInStrings(
757758
'major', ['minor', 'both', 'major'], _deprecated_since="3.3")
@@ -1495,7 +1496,8 @@ def _convert_validator_spec(key, conv):
14951496
"animation.codec": validate_string,
14961497
"animation.bitrate": validate_int,
14971498
# Controls image format when frames are written to disk
1498-
"animation.frame_format": ["png", "jpeg", "tiff", "raw", "rgba"],
1499+
"animation.frame_format": ["png", "jpeg", "tiff", "raw", "rgba", "ppm",
1500+
"sgi", "bmp", "pbm", "svg"],
14991501
# Additional arguments for HTML writer
15001502
"animation.html_args": validate_stringlist,
15011503
# Path to ffmpeg binary. If just binary name, subprocess uses $PATH.

lib/matplotlib/tests/test_rcparams.py

+9
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,15 @@ def test_Issue_1713(tmpdir):
204204
assert rc.get('timezone') == 'UTC'
205205

206206

207+
def test_animation_frame_formats():
208+
# Animation frame_format should allow any of the following
209+
# if any of these are not allowed, an exception will be raised
210+
# test for gh issue #17908
211+
for fmt in ['png', 'jpeg', 'tiff', 'raw', 'rgba', 'ppm',
212+
'sgi', 'bmp', 'pbm', 'svg']:
213+
mpl.rcParams['animation.frame_format'] = fmt
214+
215+
207216
def generate_validator_testcases(valid):
208217
validation_tests = (
209218
{'validator': validate_bool,

0 commit comments

Comments
 (0)