@@ -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
@@ -902,12 +902,13 @@ def __call__(self, x, pos=None):
902
902
sign = np .sign (x )
903
903
x = abs (x )
904
904
# only label the decades
905
+ < << << << HEAD
905
906
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 )
907
+ is_decade = is_close_to_int (fx )
908
+ exponent = np .round (fx ) if is_decade else np .floor (fx )
908
909
coeff = np .round (x / b ** exponent )
909
910
if coeff in self .sublabel :
910
- if not isDecade and self .labelOnlyBase :
911
+ if not is_decade and self .label_only_base :
911
912
return ''
912
913
elif x > 10000 :
913
914
s = '%1.0e' % x
@@ -923,10 +924,10 @@ def __call__(self, x, pos=None):
923
924
return self .fix_minus (s )
924
925
925
926
def format_data (self , value ):
926
- b = self .labelOnlyBase
927
- self .labelOnlyBase = False
927
+ b = self .label_only_base
928
+ self .label_only_base = False
928
929
value = cbook .strip_math (self .__call__ (value ))
929
- self .labelOnlyBase = b
930
+ self .label_only_base = b
930
931
return value
931
932
932
933
def format_data_short (self , value ):
@@ -987,8 +988,8 @@ def __call__(self, x, pos=None):
987
988
sign = np .sign (x )
988
989
# only label the decades
989
990
fx = math .log (abs (x )) / math .log (b )
990
- isDecade = is_close_to_int (fx )
991
- if not isDecade and self .labelOnlyBase :
991
+ is_decade = is_close_to_int (fx )
992
+ if not is_decade and self .label_only_base :
992
993
s = ''
993
994
elif abs (fx ) > 10000 :
994
995
s = '%1.0g' % fx
@@ -1045,8 +1046,9 @@ def __call__(self, x, pos=None):
1045
1046
else :
1046
1047
base = '%s' % b
1047
1048
1049
+ < << << << HEAD
1048
1050
if coeff in self .sublabel :
1049
- if not is_decade and self .labelOnlyBase :
1051
+ if not is_decade and self .label_only_basee :
1050
1052
return ''
1051
1053
elif not is_decade :
1052
1054
return self ._non_decade_format (sign_string , base , fx , usetex )
@@ -1068,9 +1070,9 @@ class LogFormatterSciNotation(LogFormatterMathtext):
1068
1070
Format values following scientific notation in a logarithmic axis
1069
1071
"""
1070
1072
1071
- def __init__ (self , base = 10.0 , labelOnlyBase = False ):
1073
+ def __init__ (self , base = 10.0 , label_only_base = False ):
1072
1074
super (LogFormatterSciNotation , self ).__init__ (base = base ,
1073
- labelOnlyBase = labelOnlyBase )
1075
+ label_only_base = label_only_base )
1074
1076
1075
1077
def _non_decade_format (self , sign_string , base , fx , usetex ):
1076
1078
'Return string for non-decade locations'
0 commit comments