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

Method inverse

lib/matplotlib/colors.py:2558–2577  ·  view source on GitHub ↗

Maps the normalized value (i.e., index in the colormap) back to image data value. Parameters ---------- value Normalized value.

(self, value)

Source from the content-addressed store, hash-verified

2556 return result
2557
2558 def inverse(self, value):
2559 """
2560 Maps the normalized value (i.e., index in the colormap) back to image
2561 data value.
2562
2563 Parameters
2564 ----------
2565 value
2566 Normalized value.
2567 """
2568 if not self.scaled():
2569 raise ValueError("Not invertible until both vmin and vmax are set")
2570 (vmin,), _ = self.process_value(self.vmin)
2571 (vmax,), _ = self.process_value(self.vmax)
2572
2573 if np.iterable(value):
2574 val = np.ma.asarray(value)
2575 return vmin + val * (vmax - vmin)
2576 else:
2577 return vmin + value * (vmax - vmin)
2578
2579 def autoscale(self, A):
2580 # docstring inherited

Callers

nothing calls this directly

Calls 2

scaledMethod · 0.95
process_valueMethod · 0.95

Tested by

no test coverage detected