add_arrows#
- Plotter.add_arrows(cent, direction, mag=1, **kwargs)#
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.BasePlotter.add_mesh()
for optional keyword arguments.
- cent
- Returns
vtk.vtkActor
VTK actor of the arrows.
Examples
Plot a random field of vectors and save a screenshot of it.
>>> import numpy as np >>> import pyvista >>> cent = np.random.random((10, 3)) >>> direction = np.random.random((10, 3)) >>> plotter = pyvista.Plotter() >>> _ = plotter.add_arrows(cent, direction, mag=2) >>> plotter.show()