Set the alpha value used for blending - not supported on all backends. Parameters ---------- alpha : float or None *alpha* must be within the 0-1 range, inclusive.
(self, alpha)
| 1061 | self.stale = False |
| 1062 | |
| 1063 | def set_alpha(self, alpha): |
| 1064 | """ |
| 1065 | Set the alpha value used for blending - not supported on all backends. |
| 1066 | |
| 1067 | Parameters |
| 1068 | ---------- |
| 1069 | alpha : float or None |
| 1070 | *alpha* must be within the 0-1 range, inclusive. |
| 1071 | """ |
| 1072 | if alpha is not None and not isinstance(alpha, Real): |
| 1073 | raise TypeError( |
| 1074 | f'alpha must be numeric or None, not {type(alpha)}') |
| 1075 | if alpha is not None and not (0 <= alpha <= 1): |
| 1076 | raise ValueError(f'alpha ({alpha}) is outside 0-1 range') |
| 1077 | if alpha != self._alpha: |
| 1078 | self._alpha = alpha |
| 1079 | self.pchanged() |
| 1080 | self.stale = True |
| 1081 | |
| 1082 | def _set_alpha_for_array(self, alpha): |
| 1083 | """ |