pyvista.examples.cells.plot_cell

Contents

pyvista.examples.cells.plot_cell#

plot_cell(
grid: PolyData | UnstructuredGrid,
cpos=None,
*,
show_normals: bool = False,
**kwargs,
)[source]#

Plot a mesh while displaying cell indices.

Parameters:
gridPolyData | UnstructuredGrid

Dataset containing one single cell (ideally), though plotting a mesh with multiple cells is supported.

Changed in version 0.47: Plotting PolyData is now supported.

cposstr, optional

Camera position.

show_normalsbool, optional

Show the face normals of the cell. Only applies to 2D or 3D cells. Cell faces with correct orientation should have the normal pointing outward.

Added in version 0.47.

**kwargsdict, optional

Additional keyword arguments when showing. See pyvista.Plotter.show().

Examples

Create and plot a single hexahedron.

>>> from pyvista import examples
>>> grid = examples.cells.Hexahedron()
>>> examples.plot_cell(grid)
../../../_images/pyvista-examples-cells-plot_cell-d06f6e71c4600fd9_00_00.png