pyvista.Plotter.add_points

pyvista.Plotter.add_points#

Plotter.add_points(points, style='points', **kwargs) Actor[source]#

Add points to a mesh.

Parameters:
pointsnumpy.ndarray or pyvista.DataSet

Array of points or the points from a pyvista object.

stylestr, default: ‘points’

Visualization style of the mesh. One of the following: style='points', style='points_gaussian'. 'points_gaussian' can be controlled with the emissive and render_points_as_spheres options.

**kwargsdict, optional

See pyvista.Plotter.add_mesh() for optional keyword arguments.

Returns:
pyvista.Actor

Actor of the mesh.

Examples

Add a numpy array of points to a mesh.

>>> import numpy as np
>>> import pyvista as pv
>>> rng = np.random.default_rng(seed=0)
>>> points = rng.random((10, 3))
>>> pl = pv.Plotter()
>>> actor = pl.add_points(
...     points, render_points_as_spheres=True, point_size=100.0
... )
>>> pl.show()
../../../_images/pyvista-Plotter-add_points-1_00_00.png

Plot using the 'points_gaussian' style

>>> points = rng.random((10, 3))
>>> pl = pv.Plotter()
>>> actor = pl.add_points(points, style='points_gaussian')
>>> pl.show()
../../../_images/pyvista-Plotter-add_points-1_01_00.png