@@ -3242,10 +3242,11 @@ def ticklabel_format(self, *, axis='both', style=None, scilimits=None,
3242
3242
axis : {'x', 'y', 'both'}, default: 'both'
3243
3243
The axis to configure. Only major ticks are affected.
3244
3244
3245
- style : {'sci', 'scientific', 'plain'}
3245
+ style : {'sci', 'scientific', 'plain', '', None}, default: None
3246
3246
Whether to use scientific notation.
3247
3247
The formatter default is to use scientific notation.
3248
3248
Sci is equivalent to scientific.
3249
+ The '' option is included solely for backwards-compatibility.
3249
3250
3250
3251
scilimits : pair of ints (m, n)
3251
3252
Scientific notation is used only for numbers outside the range
@@ -3275,7 +3276,8 @@ def ticklabel_format(self, *, axis='both', style=None, scilimits=None,
3275
3276
AttributeError
3276
3277
If the current formatter is not a `.ScalarFormatter`.
3277
3278
"""
3278
- style = style .lower ()
3279
+ if isinstance (style , str ):
3280
+ style = style .lower ()
3279
3281
axis = axis .lower ()
3280
3282
if scilimits is not None :
3281
3283
try :
@@ -3284,11 +3286,8 @@ def ticklabel_format(self, *, axis='both', style=None, scilimits=None,
3284
3286
except (ValueError , TypeError ) as err :
3285
3287
raise ValueError ("scilimits must be a sequence of 2 integers"
3286
3288
) from err
3287
- STYLES = {'sci' : True , 'scientific' : True , 'plain' : False }
3288
- if style is None :
3289
- is_sci_style = False
3290
- else :
3291
- is_sci_style = _api .check_getitem (STYLES , style = style )
3289
+ STYLES = {'sci' : True , 'scientific' : True , 'plain' : False , '' : None , None : None }
3290
+ is_sci_style = _api .check_getitem (STYLES , style = style )
3292
3291
axis_map = {** {k : [v ] for k , v in self ._axis_map .items ()},
3293
3292
'both' : list (self ._axis_map .values ())}
3294
3293
axises = _api .check_getitem (axis_map , axis = axis )
0 commit comments