@@ -1880,6 +1880,11 @@ def ticklabel_format(self, **kwargs):
1880
1880
be used for numbers outside the range
1881
1881
10`-m`:sup: to 10`n`:sup:.
1882
1882
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.
1883
1888
*axis* [ 'x' | 'y' | 'both' ]
1884
1889
============ =====================================
1885
1890
@@ -1892,13 +1897,14 @@ def ticklabel_format(self, **kwargs):
1892
1897
"""
1893
1898
style = kwargs .pop ('style' , '' ).lower ()
1894
1899
scilimits = kwargs .pop ('scilimits' , None )
1900
+ useOffset = kwargs .pop ('useOffset' , None )
1901
+ axis = kwargs .pop ('axis' , 'both' ).lower ()
1895
1902
if scilimits is not None :
1896
1903
try :
1897
1904
m , n = scilimits
1898
1905
m + n + 1 # check that both are numbers
1899
1906
except (ValueError , TypeError ):
1900
1907
raise ValueError ("scilimits must be a sequence of 2 integers" )
1901
- axis = kwargs .pop ('axis' , 'both' ).lower ()
1902
1908
if style [:3 ] == 'sci' :
1903
1909
sb = True
1904
1910
elif style in ['plain' , 'comma' ]:
@@ -1923,6 +1929,11 @@ def ticklabel_format(self, **kwargs):
1923
1929
self .xaxis .major .formatter .set_powerlimits (scilimits )
1924
1930
if axis == 'both' or axis == 'y' :
1925
1931
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 )
1926
1937
except AttributeError :
1927
1938
raise AttributeError (
1928
1939
"This method only works with the ScalarFormatter." )
0 commit comments