@@ -3222,7 +3222,7 @@ def grid(self, visible=None, which='major', axis='both', **kwargs):
3222
3222
if axis in ['y' , 'both' ]:
3223
3223
self .yaxis .grid (visible , which = which , ** kwargs )
3224
3224
3225
- def ticklabel_format (self , * , axis = 'both' , style = '' , scilimits = None ,
3225
+ def ticklabel_format (self , * , axis = 'both' , style = None , scilimits = None ,
3226
3226
useOffset = None , useLocale = None , useMathText = None ):
3227
3227
r"""
3228
3228
Configure the `.ScalarFormatter` used by default for linear Axes.
@@ -3238,6 +3238,7 @@ def ticklabel_format(self, *, axis='both', style='', scilimits=None,
3238
3238
style : {'sci', 'scientific', 'plain'}
3239
3239
Whether to use scientific notation.
3240
3240
The formatter default is to use scientific notation.
3241
+ 'sci' is equivalent to 'scientific'.
3241
3242
3242
3243
scilimits : pair of ints (m, n)
3243
3244
Scientific notation is used only for numbers outside the range
@@ -3267,7 +3268,8 @@ def ticklabel_format(self, *, axis='both', style='', scilimits=None,
3267
3268
AttributeError
3268
3269
If the current formatter is not a `.ScalarFormatter`.
3269
3270
"""
3270
- style = style .lower ()
3271
+ if isinstance (style , str ):
3272
+ style = style .lower ()
3271
3273
axis = axis .lower ()
3272
3274
if scilimits is not None :
3273
3275
try :
@@ -3276,7 +3278,8 @@ def ticklabel_format(self, *, axis='both', style='', scilimits=None,
3276
3278
except (ValueError , TypeError ) as err :
3277
3279
raise ValueError ("scilimits must be a sequence of 2 integers"
3278
3280
) from err
3279
- STYLES = {'sci' : True , 'scientific' : True , 'plain' : False , '' : None }
3281
+ STYLES = {'sci' : True , 'scientific' : True , 'plain' : False , '' : None , None : None }
3282
+ # The '' option is included for backwards-compatibility.
3280
3283
is_sci_style = _api .check_getitem (STYLES , style = style )
3281
3284
axis_map = {** {k : [v ] for k , v in self ._axis_map .items ()},
3282
3285
'both' : list (self ._axis_map .values ())}
0 commit comments