pyvista.Plotter.add_orientation_widget#
- Plotter.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:
- actor
vtk.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
.- color
ColorLike
,optional
The color of the actor. This only applies if
actor
is apyvista.DataSet
.- opacity
int
|float
, default: 1.0 Opacity of the marker.
- viewportsequence[
float
],optional
Viewport
(xstart, ystart, xend, yend)
of the widget.
- actor
- Returns:
vtk.vtkOrientationMarkerWidget
Orientation marker 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) >>> actor = pl.add_orientation_widget(pv.Arrow(), color='r') >>> pl.show()