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

Method _set_alpha_for_array

lib/matplotlib/artist.py:1082–1103  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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 """

Callers 3

test_set_alpha_for_arrayFunction · 0.95
set_alphaMethod · 0.80
set_alphaMethod · 0.80

Calls 4

pchangedMethod · 0.95
minMethod · 0.80
maxMethod · 0.80
set_alphaMethod · 0.45

Tested by 1

test_set_alpha_for_arrayFunction · 0.76