@@ -1880,6 +1880,11 @@ def ticklabel_format(self, **kwargs):
18801880 be used for numbers outside the range
18811881 10`-m`:sup: to 10`n`:sup:.
18821882 Use (0,0) to include all numbers.
1883+ *useOffset* [True | False | offset]; if True,
1884+ the offset will be calculated as needed;
1885+ if False, no offset will be used; if a
1886+ numeric offset is specified, it will be
1887+ used.
18831888 *axis* [ 'x' | 'y' | 'both' ]
18841889 ============ =====================================
18851890
@@ -1892,13 +1897,14 @@ def ticklabel_format(self, **kwargs):
18921897 """
18931898 style = kwargs .pop ('style' , '' ).lower ()
18941899 scilimits = kwargs .pop ('scilimits' , None )
1900+ useOffset = kwargs .pop ('useOffset' , None )
1901+ axis = kwargs .pop ('axis' , 'both' ).lower ()
18951902 if scilimits is not None :
18961903 try :
18971904 m , n = scilimits
18981905 m + n + 1 # check that both are numbers
18991906 except (ValueError , TypeError ):
19001907 raise ValueError ("scilimits must be a sequence of 2 integers" )
1901- axis = kwargs .pop ('axis' , 'both' ).lower ()
19021908 if style [:3 ] == 'sci' :
19031909 sb = True
19041910 elif style in ['plain' , 'comma' ]:
@@ -1923,6 +1929,11 @@ def ticklabel_format(self, **kwargs):
19231929 self .xaxis .major .formatter .set_powerlimits (scilimits )
19241930 if axis == 'both' or axis == 'y' :
19251931 self .yaxis .major .formatter .set_powerlimits (scilimits )
1932+ if useOffset is not None :
1933+ if axis == 'both' or axis == 'x' :
1934+ self .xaxis .major .formatter .set_useOffset (useOffset )
1935+ if axis == 'both' or axis == 'y' :
1936+ self .yaxis .major .formatter .set_useOffset (useOffset )
19261937 except AttributeError :
19271938 raise AttributeError (
19281939 "This method only works with the ScalarFormatter." )
0 commit comments