DataSet.set_active_scalars#
- DataSet.set_active_scalars(
- name: str | None,
- preference: PointLiteral | CellLiteral | FieldAssociation = 'cell',
Find the scalars by name and appropriately sets it as active.
To deactivate any active scalars, pass
Noneas thename.- Parameters:
- name
str, optional Name of the scalars array to assign as active. If
None, deactivates active scalars for both point and cell data.- preference
str|pyvista.core.utilities.arrays.FieldAssociation, default: “cell” 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', or the matchingFieldAssociationmember.
- name
- Returns:
pyvista.core.utilities.arrays.FieldAssociationAssociation of the scalars matching
name.pyvista_ndarrayAn array from the dataset matching
name.
Used In#
Guides
- PyVista Data Model (1 use)
API Examples
DataSetFilters.split_bodies(1 use)
Gallery Examples