Skip to content

Commit 7ab73cc

Browse files
committed
MNT: Changed name to use _ instead of CamelCase
Minor clarification to docs as well.
1 parent 45e4a46 commit 7ab73cc

File tree

1 file changed

+19
-18
lines changed

1 file changed

+19
-18
lines changed

lib/matplotlib/ticker.py

+19-18
Original file line numberDiff line numberDiff line change
@@ -829,13 +829,13 @@ class LogFormatter(Formatter):
829829
"""
830830
Format values for log axis.
831831
"""
832-
def __init__(self, base=10.0, labelOnlyBase=True):
832+
def __init__(self, base=10.0, label_only_base=True):
833833
"""
834834
`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``.
836836
"""
837837
self._base = base + 0.0
838-
self.labelOnlyBase = labelOnlyBase
838+
self.label_only_base = label_only_base
839839
self.sublabel = [1, ]
840840

841841
def base(self, base):
@@ -848,13 +848,13 @@ def base(self, base):
848848
"""
849849
self._base = base
850850

851-
def label_minor(self, labelOnlyBase):
851+
def label_minor(self, label_only_base):
852852
"""
853-
Switch minor tick labeling on or off.
853+
Switch intermediate tick labeling on or off.
854854
855-
``labelOnlyBase=True`` to turn off minor ticks.
855+
``label_only_base=True`` to turn off minor (non-decade) ticks.
856856
"""
857-
self.labelOnlyBase = labelOnlyBase
857+
self.label_only_base = label_only_base
858858

859859
def set_locs(self, locs):
860860
b = self._base
@@ -903,11 +903,11 @@ def __call__(self, x, pos=None):
903903
x = abs(x)
904904
# only label the decades
905905
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)
908908
coeff = np.round(x / b ** exponent)
909909
if coeff in self.sublabel:
910-
if not isDecade and self.labelOnlyBase:
910+
if not is_decade and self.label_only_base:
911911
return ''
912912
elif x > 10000:
913913
s = '%1.0e' % x
@@ -923,10 +923,10 @@ def __call__(self, x, pos=None):
923923
return self.fix_minus(s)
924924

925925
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
928928
value = cbook.strip_math(self.__call__(value))
929-
self.labelOnlyBase = b
929+
self.label_only_base = b
930930
return value
931931

932932
def format_data_short(self, value):
@@ -987,8 +987,8 @@ def __call__(self, x, pos=None):
987987
sign = np.sign(x)
988988
# only label the decades
989989
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:
992992
s = ''
993993
elif abs(fx) > 10000:
994994
s = '%1.0g' % fx
@@ -1045,8 +1045,9 @@ def __call__(self, x, pos=None):
10451045
else:
10461046
base = '%s' % b
10471047

1048+
<<<<<<< HEAD
10481049
if coeff in self.sublabel:
1049-
if not is_decade and self.labelOnlyBase:
1050+
if not is_decade and self.label_only_basee:
10501051
return ''
10511052
elif not is_decade:
10521053
return self._non_decade_format(sign_string, base, fx, usetex)
@@ -1068,9 +1069,9 @@ class LogFormatterSciNotation(LogFormatterMathtext):
10681069
Format values following scientific notation in a logarithmic axis
10691070
"""
10701071

1071-
def __init__(self, base=10.0, labelOnlyBase=False):
1072+
def __init__(self, base=10.0, label_only_base=False):
10721073
super(LogFormatterSciNotation, self).__init__(base=base,
1073-
labelOnlyBase=labelOnlyBase)
1074+
label_only_base=label_only_base)
10741075

10751076
def _non_decade_format(self, sign_string, base, fx, usetex):
10761077
'Return string for non-decade locations'

0 commit comments

Comments
 (0)