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

Method inverse

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

Source from the content-addressed store, hash-verified

2702 return result
2703
2704 def inverse(self, value):
2705 if not self.scaled():
2706 raise ValueError("Not invertible until both vmin and vmax are set")
2707 (vmin,), _ = self.process_value(self.vmin)
2708 (vmax,), _ = self.process_value(self.vmax)
2709 (vcenter,), _ = self.process_value(self.vcenter)
2710 result = np.interp(value, [0, 0.5, 1], [vmin, vcenter, vmax],
2711 left=-np.inf, right=np.inf)
2712 return result
2713
2714
2715class CenteredNorm(Normalize):

Callers 1

Calls 2

process_valueMethod · 0.80
scaledMethod · 0.45

Tested by 1