Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b76e234 commit 2209689Copy full SHA for 2209689
1 file changed
lib/matplotlib/scale.py
@@ -301,7 +301,10 @@ def __init__(self, thresh):
301
302
def transform(self, a):
303
masked = ma.masked_where((a < -self.thresh) | (a > self.thresh), a)
304
- return ma.log(ma.tan(masked) + 1.0 / ma.cos(masked))
+ if masked.mask.any():
305
+ return ma.log(ma.abs(ma.tan(masked) + 1.0 / ma.cos(masked)))
306
+ else:
307
+ return npy.log(npy.abs(npy.tan(a) + 1.0 / npy.cos(a)))
308
309
def inverted(self):
310
return MercatorLatitudeScale.InvertedMercatorLatitudeTransform()
@@ -346,6 +349,7 @@ def get_transform(self):
346
349
def limit_range_for_scale(self, vmin, vmax, minpos):
347
350
return max(vmin, -self.thresh), min(vmax, self.thresh)
348
351
352
+
353
_scale_mapping = {
354
'linear' : LinearScale,
355
'log' : LogScale,
0 commit comments