pyvista.Renderer.add_north_arrow_widget

pyvista.Renderer.add_north_arrow_widget#

Renderer.add_north_arrow_widget(
interactive=None,
color='#4169E1',
opacity=1.0,
line_width=2,
edge_color=None,
lighting=False,
viewport=(0, 0, 0.1, 0.1),
)[source]#

Add a geographic north arrow to the scene.

Added in version 0.44.0.

Parameters:
interactivebool, optional

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

colorColorLike, optional

Color of the north arrow.

opacityfloat, optional

Opacity of the north arrow.

line_widthfloat, optional

Width of the north edge arrow lines.

edge_colorColorLike, optional

Color of the edges.

lightingbool, optional

Enable or disable lighting on north arrow.

viewportsequence[float], default: (0, 0, 0.1, 0.1)

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

Returns:
vtk.vtkOrientationMarkerWidget

Orientation marker widget.

Examples

Use an north arrow as the orientation widget.

>>> import pyvista as pv
>>> from pyvista import examples
>>> terrain = examples.download_st_helens().warp_by_scalar()
>>> pl = pv.Plotter()
>>> actor = pl.add_mesh(terrain)
>>> widget = pl.add_north_arrow_widget()
>>> pl.enable_terrain_style(True)
>>> pl.show()
../../../_images/pyvista-Renderer-add_north_arrow_widget-1_00_00.png