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

Method inverse

lib/matplotlib/colors.py:3180–3197  ·  view source on GitHub ↗
(self, value)

Source from the content-addressed store, hash-verified

3178 return result
3179
3180 def inverse(self, value):
3181 if not self.scaled():
3182 raise ValueError("Not invertible until scaled")
3183
3184 result, is_scalar = self.process_value(value)
3185
3186 gamma = self.gamma
3187 vmin, vmax = self.vmin, self.vmax
3188
3189 resdat = result.data
3190 resdat[resdat > 0] = np.power(resdat[resdat > 0], 1 / gamma)
3191 resdat *= (vmax - vmin)
3192 resdat += vmin
3193
3194 result = np.ma.array(resdat, mask=result.mask, copy=False)
3195 if is_scalar:
3196 result = result[0]
3197 return result
3198
3199
3200class BoundaryNorm(Normalize):

Callers 1

test_PowerNormFunction · 0.95

Calls 2

process_valueMethod · 0.80
scaledMethod · 0.45

Tested by 1

test_PowerNormFunction · 0.76