RectilinearGrid.z#
- property RectilinearGrid.z: NumpyArray[float][source]#
Return or set the coordinates along the Z-direction.
- Returns:
numpy.ndarrayArray of points along the Z-direction.
Examples#
Download Python source code | Download Jupyter notebook
Return the z coordinates of a RectilinearGrid.
>>> import numpy as np
>>> import pyvista as pv
>>> xrng = np.arange(-10, 10, 10, dtype=float)
>>> yrng = np.arange(-10, 10, 10, dtype=float)
>>> zrng = np.arange(-10, 10, 10, dtype=float)
>>> grid = pv.RectilinearGrid(xrng, yrng, zrng)
>>> grid.z
array([-10., 0.])
Set the z coordinates of a RectilinearGrid.
>>> grid.z = [-10.0, 0.0, 10.0]
>>> grid.z
array([-10., 0., 10.])