@@ -458,6 +458,7 @@ def validate_whiskers(s):
458458 "(float, float)]" )
459459
460460
461+ @cbook .deprecated ("3.2" )
461462def update_savefig_format (value ):
462463 # The old savefig.extension could also have a value of "auto", but
463464 # the new savefig.format does not. We need to fix this here.
@@ -471,6 +472,20 @@ def update_savefig_format(value):
471472 return value
472473
473474
475+ # Replace by validate_string once deprecation period passes.
476+ def _update_savefig_format (value ):
477+ # The old savefig.extension could also have a value of "auto", but
478+ # the new savefig.format does not. We need to fix this here.
479+ value = validate_string (value )
480+ if value == 'auto' :
481+ cbook .warn_deprecated (
482+ "3.2" , message = "Support for setting the 'savefig.format' rcParam "
483+ "to 'auto' is deprecated since %(since)s and will be removed "
484+ "%(removal)s; set it to 'png' instead." )
485+ value = 'png'
486+ return value
487+
488+
474489validate_ps_papersize = ValidateInStrings (
475490 'ps_papersize' ,
476491 ['auto' , 'letter' , 'legal' , 'ledger' ,
@@ -1344,7 +1359,7 @@ def _validate_linestyle(ls):
13441359 'savefig.orientation' : ['portrait' , validate_orientation ],
13451360 'savefig.jpeg_quality' : [95 , validate_int ],
13461361 # value checked by backend at runtime
1347- 'savefig.format' : ['png' , update_savefig_format ],
1362+ 'savefig.format' : ['png' , _update_savefig_format ],
13481363 # options are 'tight', or 'standard'. 'standard' validates to None.
13491364 'savefig.bbox' : ['standard' , validate_bbox ],
13501365 'savefig.pad_inches' : [0.1 , validate_float ],
0 commit comments