pyvista.Plotter.add_cursor#

Plotter.add_cursor(
bounds=(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0),
focal_point=(0.0, 0.0, 0.0),
color=None,
)[source]#

Add a cursor of a PyVista or VTK dataset to the scene.

Parameters:
boundssequence[float], default: (-1.0, 1.0, -1.0, 1.0, -1.0, 1.0)

Specify the bounds in the format of:

  • (xmin, xmax, ymin, ymax, zmin, zmax)

focal_pointsequence[float], default: (0.0, 0.0, 0.0)

The focal point of the cursor.

colorColorLike, optional

Either a string, RGB sequence, or hex color string. For one of the following.

  • color='white'

  • color='w'

  • color=[1.0, 1.0, 1.0]

  • color='#FFFFFF'

Returns:
vtk.vtkActor

VTK actor of the 2D cursor.

Examples

>>> import pyvista as pv
>>> sphere = pv.Sphere()
>>> plotter = pv.Plotter()
>>> _ = plotter.add_mesh(sphere)
>>> _ = plotter.add_cursor()
>>> plotter.show()
../../../_images/pyvista-Plotter-add_cursor-1_00_00.png