pyvista.Plotter.add_points#

Plotter.add_points(points, style='points', **kwargs)[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
>>> points = np.random.random((10, 3))
>>> pl = pv.Plotter()
>>> actor = pl.add_points(
...     points, render_points_as_spheres=True, point_size=100.0
... )
>>> pl.show()
https://d33wubrfki0l68.cloudfront.net/306d12a8494775f4570700fcd11f17438b8e1e63/3f40b/_images/pyvista-plotter-add_points-1_00_00.png

Plot using the 'points_gaussian' style

>>> points = np.random.random((10, 3))
>>> pl = pv.Plotter()
>>> actor = pl.add_points(points, style='points_gaussian')
>>> pl.show()
https://d33wubrfki0l68.cloudfront.net/ebd340616c9b615a29329824fcfba9de88d1d591/0faef/_images/pyvista-plotter-add_points-1_01_00.png