Skip to content

Commit 0a98984

Browse files
committed
Don't call "asarray" in symlog transformation functions.
1 parent 1111f3d commit 0a98984

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

lib/matplotlib/scale.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,6 @@ def __init__(self, base, linthresh):
324324
self._linadjust = (np.log(linthresh) / self._log_base) / linthresh
325325

326326
def transform(self, a):
327-
a = np.asarray(a)
328327
sign = np.sign(a)
329328
masked = ma.masked_inside(a, -self.linthresh, self.linthresh, copy=False)
330329
log = sign * self.linthresh * (1 + ma.log(np.abs(masked) / self.linthresh))
@@ -352,7 +351,6 @@ def __init__(self, base, linthresh):
352351
self._linadjust = linthresh / (np.log(linthresh) / self._log_base)
353352

354353
def transform(self, a):
355-
a = np.asarray(a)
356354
sign = np.sign(a)
357355
masked = ma.masked_inside(a, -self.linthresh, self.linthresh, copy=False)
358356
exp = sign * self.linthresh * ma.exp(sign * masked / self.linthresh - 1)
@@ -393,7 +391,7 @@ def __init__(self, axis, **kwargs):
393391

394392
assert base > 0.0
395393
assert linthresh > 0.0
396-
394+
397395
self.base = base
398396
self.linthresh = linthresh
399397
self.subs = subs

0 commit comments

Comments
 (0)