add_arrows

Plotter.add_arrows(cent, direction, mag=1, **kwargs)

Add arrows to the plotter.

Parameters
centnp.ndarray

Array of centers.

directionnp.ndarray

Array of direction vectors.

magfloat, optional

Amount to scale the direction vectors.

**kwargsdict, optional

See pyvista.BasePlotter.add_mesh() for optional keyword arguments.

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()
../../../_images/pyvista-Plotter-add_arrows-1_00_00.png