pyvista.DataSetAttributes.active_scalars_name#

property DataSetAttributes.active_scalars_name: str | None[source]#

Return name of the active scalars.

Returns:
Optional[str]

Name of the active scalars.

Examples

Add two arrays to the mesh point data. Note how the first array becomes the active scalars since the mesh contained no scalars.

>>> import pyvista as pv
>>> mesh = pv.Sphere()
>>> mesh.point_data['my_data'] = range(mesh.n_points)
>>> mesh.point_data['my_other_data'] = range(mesh.n_points)
>>> mesh.point_data.active_scalars_name
'my_data'

Set the name of the active scalars.

>>> mesh.point_data.active_scalars_name = 'my_other_data'
>>> mesh.point_data.active_scalars_name
'my_other_data'