Set the colormap for luminance data. Parameters ---------- cmap : `.Colormap` or str or None
(self, cmap)
| 212 | self.norm.autoscale_None(A) |
| 213 | |
| 214 | def _set_cmap(self, cmap): |
| 215 | """ |
| 216 | Set the colormap for luminance data. |
| 217 | |
| 218 | Parameters |
| 219 | ---------- |
| 220 | cmap : `.Colormap` or str or None |
| 221 | """ |
| 222 | in_init = self._cmap is None |
| 223 | cmap_obj = _ensure_cmap(cmap, accept_multivariate=True) |
| 224 | if not in_init and self.norm.n_components != cmap_obj.n_variates: |
| 225 | raise ValueError(f"The colormap {cmap} does not support " |
| 226 | f"{self.norm.n_components} variates as required by " |
| 227 | f"the {type(self.norm)} on this Colorizer") |
| 228 | self._cmap = cmap_obj |
| 229 | if not in_init: |
| 230 | self.changed() # Things are not set up properly yet. |
| 231 | |
| 232 | @property |
| 233 | def cmap(self): |
no test coverage detected