set_default_active_scalars#
- set_default_active_scalars(mesh: DataSet) _ActiveArrayExistsInfoTuple[source]#
Set a default scalars array on mesh, if not already set.
If an active scalars already exists, no changes are made.
If an active scalars does not exist, it checks for point or cell arrays. If only one exists, then it is set as the active scalars. Otherwise, an error is raised.
Changed in version 0.45: The field and name of the active array is now returned. Previously,
Nonewas returned.- Parameters:
- mesh
pyvista.DataSet Dataset to set default active scalars.
- mesh
- Returns:
- Raises:
pyvista.core.errors.MissingDataErrorIf no arrays exist.
pyvista.core.errors.AmbiguousDataErrorIf more than one array exists.