add_orientation_widget#
- Plotter.add_orientation_widget(actor, interactive=None, color=None, opacity=1.0)#
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
orpyvista.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
color_like
,optional
The color of the actor. This only applies if
actor
is apyvista.DataSet
.- opacity
int
orfloat
,optional
Opacity of the marker.
- actor
- Returns
vtk.vtkOrientationMarkerWidget
Orientation marker widget.
Examples
Use an Arrow as the orientation widget.
>>> import pyvista >>> pl = pyvista.Plotter() >>> actor = pl.add_mesh(pyvista.Cube(), show_edges=True) >>> actor = pl.add_orientation_widget(pyvista.Arrow(), color='r') >>> pl.show()