pyvista.DataSetMapper.set_custom_opacity#

DataSetMapper.set_custom_opacity(opacity, color, n_colors, preference='point')[source]#

Set custom opacity.

Parameters:
opacitynumpy.ndarray

Opacity array to color the dataset. Array length must match either the number of points or cells.

colorpyvista.ColorLike

The color to use with the opacity array.

n_colorsint

Number of colors to use.

preferencestr, default: ‘point’

Either 'point' or 'cell'. Used when the number of cells matches the number of points.