pyvista.Renderer.add_orientation_widget

pyvista.Renderer.add_orientation_widget#

Renderer.add_orientation_widget(
actor,
interactive=None,
color=None,
opacity=1.0,
viewport=None,
)[source]#

Use the given actor in an orientation marker widget.

Color and opacity are only valid arguments if a mesh is passed.

Parameters:
actorvtk.vtkActor | pyvista.DataSet

The mesh or actor to use as the marker.

interactivebool, optional

Control if the orientation widget is interactive. By default uses the value from pyvista.global_theme.interactive.

colorColorLike, optional

The color of the actor. This only applies if actor is a pyvista.DataSet.

opacityint | float, default: 1.0

Opacity of the marker.

viewportsequence[float], optional

Viewport (xstart, ystart, xend, yend) of the widget.

Returns:
vtk.vtkOrientationMarkerWidget

Orientation marker widget.

See also

add_axes

Add an axes orientation widget.

Examples

Use an Arrow as the orientation widget.

>>> import pyvista as pv
>>> pl = pv.Plotter()
>>> actor = pl.add_mesh(pv.Cube(), show_edges=True)
>>> widget = pl.add_orientation_widget(pv.Arrow(), color='r')
>>> pl.show()
../../../_images/pyvista-Renderer-add_orientation_widget-1_00_00.png