field_data

property DataObject.field_data: pyvista.core.datasetattributes.DataSetAttributes

Return FieldData as DataSetAttributes.

Use field data when size of the data you wish to associate with the dataset does not match the number of points or cells of the dataset.

Examples

Add field data to a PolyData dataset and then return it.

>>> import pyvista
>>> import numpy as np
>>> mesh = pyvista.Sphere()
>>> mesh.field_data['my-field-data'] = np.arange(10)
>>> mesh.field_data['my-field-data']
pyvista_ndarray([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])