MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / transform_non_affine

Method transform_non_affine

lib/matplotlib/scale.py:507–520  ·  view source on GitHub ↗
(self, values)

Source from the content-addressed store, hash-verified

505 self.linscale = linscale
506
507 def transform_non_affine(self, values):
508 linscale_adj = self.linscale / (1.0 - 1.0 / self.base)
509 log_base = np.log(self.base)
510
511 abs_a = np.abs(values)
512 inside = abs_a <= self.linthresh
513 if np.all(inside): # Fast path: all values in linear region
514 return values * linscale_adj
515 with np.errstate(divide="ignore", invalid="ignore"):
516 out = np.sign(values) * self.linthresh * (
517 linscale_adj - np.log(self.linthresh) / log_base +
518 np.log(abs_a) / log_base)
519 out[inside] = values[inside] * linscale_adj
520 return out
521
522 def inverted(self):
523 return InvertedSymmetricalLogTransform(self.base, self.linthresh,

Callers 1

test_symlog_mask_nanFunction · 0.95

Calls 1

signMethod · 0.80

Tested by 1

test_symlog_mask_nanFunction · 0.76