Plotter.add_arrows#
- Plotter.add_arrows( ) 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.ActorActor of the arrows.
Examples#
Download Python source code | Download Jupyter notebook
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))
>>> pl = pv.Plotter()
>>> _ = pl.add_arrows(cent, direction, mag=2)
>>> pl.show()