pyvista.plotting.mapper._BaseMapper.interpolate_before_map#

property _BaseMapper.interpolate_before_map: bool[source]#

Return or set the interpolation of scalars before mapping.

Enabling makes for a smoother scalars display. When False, OpenGL will interpolate the mapped colors which can result in showing colors that are not present in the color map.

Examples

Disable interpolation before mapping.

>>> import pyvista as pv
>>> dataset = pv.MultiBlock(
...     [pv.Cube(), pv.Sphere(center=(0, 0, 1))]
... )
>>> dataset[0].point_data['data'] = dataset[0].points[:, 2]
>>> dataset[1].point_data['data'] = dataset[1].points[:, 2]
>>> pl = pv.Plotter()
>>> actor, mapper = pl.add_composite(
...     dataset,
...     show_scalar_bar=False,
...     n_colors=3,
...     cmap='bwr',
... )
>>> mapper.interpolate_before_map = False
>>> pl.show()
https://d33wubrfki0l68.cloudfront.net/569bf70f19de1d630a77c2baa9a44a1d77f76498/50fce/_images/pyvista-plotting-mapper-_basemapper-interpolate_before_map-1_00_00.png

Enable interpolation before mapping.

>>> pl = pv.Plotter()
>>> actor, mapper = pl.add_composite(
...     dataset,
...     show_scalar_bar=False,
...     n_colors=3,
...     cmap='bwr',
... )
>>> mapper.interpolate_before_map = True
>>> pl.show()
https://d33wubrfki0l68.cloudfront.net/079883392795a0ec1106ef13dc4aa850f685f83b/51c3a/_images/pyvista-plotting-mapper-_basemapper-interpolate_before_map-1_01_00.png

See Interpolate Before Mapping for additional explanation regarding this attribute.