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
boundslength 6 sequence

Specify the bounds in the format of:

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

Defaults to (-1.0, 1.0, -1.0, 1.0, -1.0, 1.0).

focal_pointlist or tuple, optional

The focal point of the cursor.

Defaults to (0.0, 0.0, 0.0).

colorcolor_like, 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
>>> sphere = pyvista.Sphere()
>>> plotter = pyvista.Plotter()
>>> _ = plotter.add_mesh(sphere)
>>> _ = plotter.add_cursor()
>>> plotter.show()
../../../_images/pyvista-Plotter-add_cursor-1_00_00.png