Skip to content

Commit 869a776

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

File tree

1 file changed

+20
-18
lines changed

1 file changed

+20
-18
lines changed

lib/matplotlib/ticker.py

Lines changed: 20 additions & 18 deletions
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
@@ -902,12 +902,13 @@ def __call__(self, x, pos=None):
902902
sign = np.sign(x)
903903
x = abs(x)
904904
# only label the decades
905+
<<<<<<< HEAD
905906
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)
908909
coeff = np.round(x / b ** exponent)
909910
if coeff in self.sublabel:
910-
if not isDecade and self.labelOnlyBase:
911+
if not is_decade and self.label_only_base:
911912
return ''
912913
elif x > 10000:
913914
s = '%1.0e' % x
@@ -923,10 +924,10 @@ def __call__(self, x, pos=None):
923924
return self.fix_minus(s)
924925

925926
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
928929
value = cbook.strip_math(self.__call__(value))
929-
self.labelOnlyBase = b
930+
self.label_only_base = b
930931
return value
931932

932933
def format_data_short(self, value):
@@ -987,8 +988,8 @@ def __call__(self, x, pos=None):
987988
sign = np.sign(x)
988989
# only label the decades
989990
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:
992993
s = ''
993994
elif abs(fx) > 10000:
994995
s = '%1.0g' % fx
@@ -1045,8 +1046,9 @@ def __call__(self, x, pos=None):
10451046
else:
10461047
base = '%s' % b
10471048

1049+
<<<<<<< HEAD
10481050
if coeff in self.sublabel:
1049-
if not is_decade and self.labelOnlyBase:
1051+
if not is_decade and self.label_only_basee:
10501052
return ''
10511053
elif not is_decade:
10521054
return self._non_decade_format(sign_string, base, fx, usetex)
@@ -1068,9 +1070,9 @@ class LogFormatterSciNotation(LogFormatterMathtext):
10681070
Format values following scientific notation in a logarithmic axis
10691071
"""
10701072

1071-
def __init__(self, base=10.0, labelOnlyBase=False):
1073+
def __init__(self, base=10.0, label_only_base=False):
10721074
super(LogFormatterSciNotation, self).__init__(base=base,
1073-
labelOnlyBase=labelOnlyBase)
1075+
label_only_base=label_only_base)
10741076

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

0 commit comments

Comments
 (0)