pyvista.DataSet.active_scalars_info#
- property DataSet.active_scalars_info: ActiveArrayInfoTuple[source]#
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
andname
.
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 as pv >>> mesh = pv.Sphere() >>> mesh['Z Height'] = mesh.points[:, 2] >>> mesh.active_scalars_info ActiveArrayInfoTuple(association=<FieldAssociation.POINT: 0>, name='Z Height')