pyvista.DataSetMapper#

class DataSetMapper(
dataset: DataSet | None = None,
theme: Theme | None = None,
)[source]#

Wrap _vtk.vtkDataSetMapper.

Parameters:
datasetpyvista.DataSet, optional

Dataset to assign to this mapper.

themepyvista.plotting.themes.Theme, optional

Plot-specific theme.

Examples

Create a mapper outside pyvista.Plotter and assign it to an actor.

>>> import pyvista as pv
>>> mesh = pv.Cube()
>>> mapper = pv.DataSetMapper(dataset=mesh)
>>> actor = pv.Actor(mapper=mapper)
>>> actor.plot()
../../../_images/pyvista-DataSetMapper-1_00_00.png

Methods

DataSetMapper.as_rgba()

Convert the active scalars to RGBA.

DataSetMapper.set_custom_opacity(opacity, ...)

Set custom opacity.

DataSetMapper.set_scalars(scalars, scalars_name)

Set the scalars on this mapper.

Attributes

DataSetMapper.cmap

Colormap assigned to this mapper.

DataSetMapper.dataset

Return or set the dataset assigned to this mapper.

DataSetMapper.resolve

Set or return the global flag to avoid z-buffer resolution.