@@ -3242,10 +3242,11 @@ def ticklabel_format(self, *, axis='both', style=None, scilimits=None,
32423242 axis : {'x', 'y', 'both'}, default: 'both'
32433243 The axis to configure. Only major ticks are affected.
32443244
3245- style : {'sci', 'scientific', 'plain'}
3245+ style : {'sci', 'scientific', 'plain', '', None}, default: None
32463246 Whether to use scientific notation.
32473247 The formatter default is to use scientific notation.
32483248 Sci is equivalent to scientific.
3249+ The '' option is included solely for backwards-compatibility.
32493250
32503251 scilimits : pair of ints (m, n)
32513252 Scientific notation is used only for numbers outside the range
@@ -3275,7 +3276,8 @@ def ticklabel_format(self, *, axis='both', style=None, scilimits=None,
32753276 AttributeError
32763277 If the current formatter is not a `.ScalarFormatter`.
32773278 """
3278- style = style.lower()
3279+ if isinstance(style, str):
3280+ style = style.lower()
32793281 axis = axis.lower()
32803282 if scilimits is not None:
32813283 try:
@@ -3284,11 +3286,8 @@ def ticklabel_format(self, *, axis='both', style=None, scilimits=None,
32843286 except (ValueError, TypeError) as err:
32853287 raise ValueError("scilimits must be a sequence of 2 integers"
32863288 ) 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)
32923291 axis_map = {**{k: [v] for k, v in self._axis_map.items()},
32933292 'both': list(self._axis_map.values())}
32943293 axises = _api.check_getitem(axis_map, axis=axis)
0 commit comments