Plotter.enable_point_picking(callback=None, show_message=True, font_size=18, color='pink', point_size=10, use_mesh=False, show_point=True, tolerance=0.025, pickable_window=False, left_clicking=False, **kwargs)#

Enable picking at points.

Enable picking a point at the mouse location in the render view using the P key. This point is saved to the .picked_point attrbute on the plotter. Pass a callback function that takes that point as an argument. The picked point can either be a point on the first intersecting mesh, or a point in the 3D window.

callbackcallable(), optional

When input, calls this function after a pick is made. The picked point is input as the first parameter to this function. If use_mesh is True, the callback function will be passed a pointer to the picked mesh and the point ID of the selected mesh.

show_messagebool or str, optional

Show the message about how to use the point picking tool. If this is a string, that will be the message shown.

font_sizeint, optional

Sets the size of the message.

colorcolor_like, optional

The color of the selected mesh when shown.

point_sizeint, optional

Size of picked points if show_point is True. Default 10.

use_meshbool, optional

If True, the callback function will be passed a pointer to the picked mesh and the point ID of the selected mesh.

show_pointbool, optional

Show the picked point after clicking.

tolerancefloat, optional

Specify tolerance for performing pick operation. Tolerance is specified as fraction of rendering window size. Rendering window size is measured across diagonal.

pickable_windowbool, optional

When True, points in the 3D window are pickable. Default to False.

left_clickingbool, optional

When True, points can be picked by clicking the left mousebutton. Default to False. Note, if enabled, left-clicking will not display the bounding box around the picked mesh.

**kwargsdict, optional

All remaining keyword arguments are used to control how the picked point is interactively displayed.


Enable point picking with a custom message.

>>> import pyvista as pv
>>> pl = pv.Plotter()
>>> _ = pl.add_mesh(pv.Sphere())
>>> _ = pl.add_mesh(pv.Cube(), pickable=False)
>>> pl.enable_point_picking(show_message="Press P to pick")

See Picking points on a mesh for a full example using this method.