pyvista.Plotter.add_cursor

pyvista.Plotter.add_cursor#

Plotter.add_cursor(
bounds: Sequence[float] = (-1.0, 1.0, -1.0, 1.0, -1.0, 1.0),
focal_point: Sequence[float] = (0.0, 0.0, 0.0),
color: ColorLike | None = None,
) _vtk.vtkActor[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:

  • (x_min, x_max, y_min, y_max, z_min, z_max)

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:
vtkActor

VTK actor of the 2D cursor.

Examples

>>> import pyvista as pv
>>> sphere = pv.Sphere()
>>> pl = pv.Plotter()
>>> _ = pl.add_mesh(sphere)
>>> _ = pl.add_cursor()
>>> pl.show()
../../../_images/pyvista-Plotter-add_cursor-37e1ca5f7fab47d8_00_00.png