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

Method set_alpha

lib/matplotlib/artist.py:1063–1080  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers 2

test_set_alphaFunction · 0.95
_set_alpha_for_arrayMethod · 0.45

Calls 1

pchangedMethod · 0.95

Tested by 1

test_set_alphaFunction · 0.76