Set the alpha value used for blending - not supported on all backends. Parameters ---------- alpha : array-like or float or None All values must be within the 0-1 range, inclusive. Masked values and nans are not supported.
(self, alpha)
| 1080 | self.stale = True |
| 1081 | |
| 1082 | def _set_alpha_for_array(self, alpha): |
| 1083 | """ |
| 1084 | Set the alpha value used for blending - not supported on all backends. |
| 1085 | |
| 1086 | Parameters |
| 1087 | ---------- |
| 1088 | alpha : array-like or float or None |
| 1089 | All values must be within the 0-1 range, inclusive. |
| 1090 | Masked values and nans are not supported. |
| 1091 | """ |
| 1092 | if isinstance(alpha, str): |
| 1093 | raise TypeError("alpha must be numeric or None, not a string") |
| 1094 | if not np.iterable(alpha): |
| 1095 | Artist.set_alpha(self, alpha) |
| 1096 | return |
| 1097 | alpha = np.asarray(alpha) |
| 1098 | if not (0 <= alpha.min() and alpha.max() <= 1): |
| 1099 | raise ValueError('alpha must be between 0 and 1, inclusive, ' |
| 1100 | f'but min is {alpha.min()}, max is {alpha.max()}') |
| 1101 | self._alpha = alpha |
| 1102 | self.pchanged() |
| 1103 | self.stale = True |
| 1104 | |
| 1105 | def set_visible(self, b): |
| 1106 | """ |