ContinuousColormap.set_alpha¶
- ContinuousColormap.set_alpha(alpha, coords=None, ratios=None)[source]¶
Set the opacity for the entire colormap or set up an opacity gradation.
- Parameters
alpha (
floator sequence offloat) – If float, this is the opacity for the entire colormap. If sequence of float, the colormap traverses these opacity values.coords (sequence of
float, optional) – Colormap coordinates for the opacity values. The first and last coordinates must be0and1. Ifalphais not scalar, the default coordinates arenp.linspace(0, 1, len(alpha)).ratios (sequence of
float, optional) – Relative extent of each opacity transition segment. Length should equallen(alpha) + 1. For examplecmap.set_alpha((1, 1, 0), ratios=(2, 1))creates a transtion from 100 percent to 0 percent opacity in the right third of the colormap.
See also