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

Method _get_scalar_alpha

lib/matplotlib/image.py:330–341  ·  view source on GitHub ↗

Get a scalar alpha value to be applied to the artist as a whole. If the alpha value is a matrix, the method returns 1.0 because pixels have individual alpha values (see `~._ImageBase._make_image` for details). If the alpha value is a scalar, the method returns said

(self)

Source from the content-addressed store, hash-verified

328 self._imcache = None
329
330 def _get_scalar_alpha(self):
331 """
332 Get a scalar alpha value to be applied to the artist as a whole.
333
334 If the alpha value is a matrix, the method returns 1.0 because pixels
335 have individual alpha values (see `~._ImageBase._make_image` for
336 details). If the alpha value is a scalar, the method returns said value
337 to be applied to the artist as a whole because pixels do not have
338 individual alpha values.
339 """
340 return 1.0 if self._alpha is None or np.ndim(self._alpha) > 0 \
341 else self._alpha
342
343 def changed(self):
344 """

Callers 3

_make_imageMethod · 0.95
drawMethod · 0.95
composite_imagesFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected