Maps the normalized value (i.e., index in the colormap) back to image data value. Parameters ---------- value Normalized value.
(self, value)
| 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 |
nothing calls this directly
no test coverage detected