property DataSetAttributes.active_scalars: Optional[pyvista.core.pyvista_ndarray.pyvista_ndarray]#

Return the active scalars.

Changed in version 0.32.0: Can no longer be used to set the active scalars. Either use DataSetAttributes.set_scalars() or if the array already exists, assign to DataSetAttribute.active_scalars_name.


Associate point data to a simple cube mesh and show that the active scalars in the point array are the most recently added array.

>>> import pyvista
>>> import numpy as np
>>> mesh = pyvista.Cube()
>>> mesh.point_data['data0'] = np.arange(mesh.n_points)
>>> mesh.point_data.active_scalars
pyvista_ndarray([0, 1, 2, 3, 4, 5, 6, 7])