Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8418f09

Browse files
author
Fabian Kloosterman
committed
PEP8 compatibility fixes. Changed nonpos default for LogTransform.
1 parent b5652bf commit 8418f09

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

lib/matplotlib/scale.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ class LogTransformBase(Transform):
9393
is_separable = True
9494
has_inverse = True
9595

96-
def __init__(self, nonpos='mask'):
96+
def __init__(self, nonpos='clip'):
9797
Transform.__init__(self)
9898
self._clip = {"clip": True, "mask": False}[nonpos]
9999

@@ -115,7 +115,9 @@ def transform_non_affine(self, a):
115115
return out
116116

117117
def __str__(self):
118-
return "{}({!r})".format(type(self).__name__, "clip" if self._clip else "mask")
118+
return "{}({!r})".format(type(self).__name__,
119+
"clip" if self._clip else "mask")
120+
119121

120122
class InvertedLogTransformBase(Transform):
121123
input_dims = 1
@@ -173,7 +175,7 @@ def inverted(self):
173175

174176

175177
class LogTransform(LogTransformBase):
176-
def __init__(self, base, nonpos='mask'):
178+
def __init__(self, base, nonpos='clip'):
177179
LogTransformBase.__init__(self, nonpos)
178180
self.base = base
179181

@@ -471,7 +473,8 @@ def inverted(self):
471473
return LogisticTransform(self._nonpos)
472474

473475
def __str__(self):
474-
return "{}({!r})".format(type(self).__name__, "clip" if self._clip else "mask")
476+
return "{}({!r})".format(type(self).__name__,
477+
"clip" if self._clip else "mask")
475478

476479

477480
class LogisticTransform(Transform):

lib/matplotlib/tests/test_scale.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ def test_logscale_invert_transform():
8080
# get transformation from data to axes
8181
tform = (ax.transAxes + ax.transData.inverted()).inverted()
8282

83+
8384
def test_logscale_transform_repr():
8485
fig, ax = plt.subplots()
8586
ax.set_yscale('log')

0 commit comments

Comments
 (0)