@@ -829,13 +829,13 @@ class LogFormatter(Formatter):
829
829
"""
830
830
Format values for log axis.
831
831
"""
832
- def __init__ (self , base = 10.0 , labelOnlyBase = True ):
832
+ def __init__ (self , base = 10.0 , label_only_base = True ):
833
833
"""
834
834
`base` is used to locate the decade tick, which will be the only
835
- one to be labeled if `labelOnlyBase ` is ``True``.
835
+ one to be labeled if `label_only_base ` is ``True``.
836
836
"""
837
837
self ._base = base + 0.0
838
- self .labelOnlyBase = labelOnlyBase
838
+ self .label_only_base = label_only_base
839
839
self .sublabel = [1 , ]
840
840
841
841
def base (self , base ):
@@ -848,13 +848,13 @@ def base(self, base):
848
848
"""
849
849
self ._base = base
850
850
851
- def label_minor (self , labelOnlyBase ):
851
+ def label_minor (self , label_only_base ):
852
852
"""
853
- Switch minor tick labeling on or off.
853
+ Switch intermediate tick labeling on or off.
854
854
855
- ``labelOnlyBase =True`` to turn off minor ticks.
855
+ ``label_only_base =True`` to turn off minor (non-decade) ticks.
856
856
"""
857
- self .labelOnlyBase = labelOnlyBase
857
+ self .label_only_base = label_only_base
858
858
859
859
def set_locs (self , locs ):
860
860
b = self ._base
@@ -903,11 +903,11 @@ def __call__(self, x, pos=None):
903
903
x = abs (x )
904
904
# only label the decades
905
905
fx = math .log (x ) / math .log (b )
906
- isDecade = is_close_to_int (fx )
907
- exponent = np .round (fx ) if isDecade else np .floor (fx )
906
+ is_decade = is_close_to_int (fx )
907
+ exponent = np .round (fx ) if is_decade else np .floor (fx )
908
908
coeff = np .round (x / b ** exponent )
909
909
if coeff in self .sublabel :
910
- if not isDecade and self .labelOnlyBase :
910
+ if not is_decade and self .label_only_base :
911
911
return ''
912
912
elif x > 10000 :
913
913
s = '%1.0e' % x
@@ -923,10 +923,10 @@ def __call__(self, x, pos=None):
923
923
return self .fix_minus (s )
924
924
925
925
def format_data (self , value ):
926
- b = self .labelOnlyBase
927
- self .labelOnlyBase = False
926
+ b = self .label_only_base
927
+ self .label_only_base = False
928
928
value = cbook .strip_math (self .__call__ (value ))
929
- self .labelOnlyBase = b
929
+ self .label_only_base = b
930
930
return value
931
931
932
932
def format_data_short (self , value ):
@@ -987,8 +987,8 @@ def __call__(self, x, pos=None):
987
987
sign = np .sign (x )
988
988
# only label the decades
989
989
fx = math .log (abs (x )) / math .log (b )
990
- isDecade = is_close_to_int (fx )
991
- if not isDecade and self .labelOnlyBase :
990
+ is_decade = is_close_to_int (fx )
991
+ if not is_decade and self .label_only_base :
992
992
s = ''
993
993
elif abs (fx ) > 10000 :
994
994
s = '%1.0g' % fx
@@ -1046,7 +1046,7 @@ def __call__(self, x, pos=None):
1046
1046
base = '%s' % b
1047
1047
1048
1048
if coeff in self .sublabel :
1049
- if not is_decade and self .labelOnlyBase :
1049
+ if not is_decade and self .label_only_basee :
1050
1050
return ''
1051
1051
elif not is_decade :
1052
1052
return self ._non_decade_format (sign_string , base , fx , usetex )
@@ -1068,9 +1068,9 @@ class LogFormatterSciNotation(LogFormatterMathtext):
1068
1068
Format values following scientific notation in a logarithmic axis
1069
1069
"""
1070
1070
1071
- def __init__ (self , base = 10.0 , labelOnlyBase = False ):
1071
+ def __init__ (self , base = 10.0 , label_only_base = False ):
1072
1072
super (LogFormatterSciNotation , self ).__init__ (base = base ,
1073
- labelOnlyBase = labelOnlyBase )
1073
+ label_only_base = label_only_base )
1074
1074
1075
1075
def _non_decade_format (self , sign_string , base , fx , usetex ):
1076
1076
'Return string for non-decade locations'
0 commit comments