pyvista.AxesAssembly.orientation#

property AxesAssembly.orientation: tuple[float, float, float][source]#

Return or set the axes orientation angles.

Orientation angles of the axes which define rotations about the world’s x-y-z axes. The angles are specified in degrees and in x-y-z order. However, the actual rotations are applied in the following order: rotate_y() first, then rotate_x() and finally rotate_z().

Rotations are applied about the specified origin.

Examples

Create axes positioned above the origin and set its orientation.

>>> import pyvista as pv
>>> axes = pv.AxesAssembly(
...     position=(0, 0, 2), orientation=(45, 0, 0)
... )

Create default non-oriented axes as well for reference.

>>> reference_axes = pv.AxesAssembly(
...     x_color='black', y_color='black', z_color='black'
... )

Plot the axes. Note how the axes are rotated about the origin (0, 0, 0) by default, such that the rotated axes appear directly above the reference axes.

>>> pl = pv.Plotter()
>>> _ = pl.add_actor(axes)
>>> _ = pl.add_actor(reference_axes)
>>> pl.show()
../../../_images/pyvista-AxesAssembly-orientation-1_00_00.png

Now change the origin of the axes and plot the result. Since the rotation is performed about a different point, the final position of the axes changes.

>>> axes.origin = (2, 2, 2)
>>> pl = pv.Plotter()
>>> _ = pl.add_actor(axes)
>>> _ = pl.add_actor(reference_axes)
>>> pl.show()
../../../_images/pyvista-AxesAssembly-orientation-1_01_00.png