pyvista.Plotter.add_points#
- Plotter.add_points(points, style='points', **kwargs)[source]#
Add points to a mesh.
- Parameters:
- points
numpy.ndarray
orpyvista.DataSet
Array of points or the points from a pyvista object.
- style
str
, default: ‘points’ Visualization style of the mesh. One of the following:
style='points'
,style='points_gaussian'
.'points_gaussian'
can be controlled with theemissive
andrender_points_as_spheres
options.- **kwargs
dict
,optional
See
pyvista.Plotter.add_mesh()
for optional keyword arguments.
- points
- 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()
Plot using the
'points_gaussian'
style>>> points = rng.random((10, 3)) >>> pl = pv.Plotter() >>> actor = pl.add_points(points, style='points_gaussian') >>> pl.show()