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
>>> cent = np.random.random(3)
>>> direction = np.random.random(3)
>>> pyvista.plot_arrows(cent, direction)

Plot 100 random arrows.

>>> import numpy as np
>>> import pyvista
>>> cent = np.random.random((100, 3))
>>> direction = np.random.random((100, 3))
>>> pyvista.plot_arrows(cent, direction)
https://d33wubrfki0l68.cloudfront.net/4e6c8b4a4b3de3d6795be6178b37e540671caefe/7c112/_images/pyvista-plot_arrows-1_00_00.png
https://d33wubrfki0l68.cloudfront.net/45ad28cc71f947ef9d174e258e13fd6df0690dd4/c98f9/_images/pyvista-plot_arrows-1_00_01.png