pyvista.Plotter.add_arrows#
- Plotter.add_arrows(cent, direction, mag=1, **kwargs) Actor [source]#
Add arrows to the plotter.
- Parameters:
- cent
np.ndarray
Array of centers.
- direction
np.ndarray
Array of direction vectors.
- mag
float
,optional
Amount to scale the direction vectors.
- **kwargs
dict
,optional
See
pyvista.Plotter.add_mesh()
for optional keyword arguments.
- cent
- Returns:
pyvista.Actor
Actor of the arrows.
Examples
Plot a random field of vectors and save a screenshot of it.
>>> import numpy as np >>> import pyvista as pv >>> rng = np.random.default_rng(seed=0) >>> cent = rng.random((10, 3)) >>> direction = rng.random((10, 3)) >>> plotter = pv.Plotter() >>> _ = plotter.add_arrows(cent, direction, mag=2) >>> plotter.show()