pyvista.examples.cells.Pixel

Contents

pyvista.examples.cells.Pixel#

Pixel() UnstructuredGrid[source]#

Create a pyvista.UnstructuredGrid containing a single pixel.

This cell corresponds to the pyvista.CellType.PIXEL cell type.

Returns:
pyvista.UnstructuredGrid

UnstructuredGrid containing a single pixel.

Examples

Create and plot a single pixel.

>>> from pyvista import examples
>>> grid = examples.cells.Pixel()
>>> examples.plot_cell(grid, cpos='xy')

List the grid’s cells.

>>> grid.cells
array([4, 0, 1, 2, 3])

List the grid’s points.

>>> grid.points
pyvista_ndarray([[0., 0., 0.],
                 [1., 0., 0.],
                 [0., 1., 0.],
                 [1., 1., 0.]])
>>> grid.celltypes  # same as pyvista.CellType.PIXEL
array([8], dtype=uint8)
../../../_images/pyvista-examples-cells-Pixel-1_00_00.png