set_active_scalars#

UniformGrid.set_active_scalars(name: Optional[str], preference='cell')#

Find the scalars by name and appropriately sets it as active.

To deactivate any active scalars, pass None as the name.

Parameters:
namestr or None

Name of the scalars array to assign as active. If None, deactivates active scalars for both point and cell data.

preferencestr, optional

If there are two arrays of the same name associated with points or cells, it will prioritize an array matching this type. Can be either 'cell' or 'point'.

Returns:
pyvista.FieldAssociation

Association of the scalars matching name.

numpy.ndarray

An array from the dataset matching name.