pyvista.plot_arrows#

plot_arrows(cent, direction, **kwargs)[source]#

Plot arrows as vectors.

Parameters:
centarray_like[float]

Accepts a single 3d point or array of 3d points.

directionarray_like[float]

Accepts a single 3d point or array of 3d vectors. Must contain the same number of items as cent.

**kwargsdict, optional

See pyvista.plot().

Returns:
tuple

See the returns of pyvista.plot().

See also

pyvista.plot

Examples

Plot a single random arrow.

>>> import numpy as np
>>> import pyvista as pv
>>> cent = np.random.random(3)
>>> direction = np.random.random(3)
>>> pv.plot_arrows(cent, direction)

Plot 100 random arrows.

>>> import numpy as np
>>> import pyvista as pv
>>> cent = np.random.random((100, 3))
>>> direction = np.random.random((100, 3))
>>> pv.plot_arrows(cent, direction)
../../../_images/pyvista-plot_arrows-1_00_00.png
../../../_images/pyvista-plot_arrows-1_00_01.png