active_scalars_info

property ExplicitStructuredGrid.active_scalars_info: pyvista.core.dataset.ActiveArrayInfo

Return the active scalar’s association and name.

Association refers to the data association (e.g. point, cell, or field) of the active scalars.

Returns
ActiveArrayInfo

The scalars info in an object with namedtuple semantics, with attributes association and name.

Notes

If both cell and point scalars are present and neither have been set active within at the dataset level, point scalars will be made active.

Examples

Create a mesh, add scalars to the mesh, and return the active scalars info. Note how when the scalars are added, they automatically become the active scalars.

>>> import pyvista
>>> mesh = pyvista.Sphere()
>>> mesh['Z Height'] = mesh.points[:, 2]
>>> mesh.active_scalars_info
ActiveArrayInfo(association=<FieldAssociation.POINT: 0>, name='Z Height')