skspatial.objects.Vector.plot_3d

Vector.plot_3d(ax_3d: mpl_toolkits.mplot3d.axes3d.Axes3D, point: Union[numpy.ndarray, Sequence] = (0, 0, 0), scalar: float = 1, **kwargs) None[source]

Plot a 3D vector.

The vector is plotted by connecting two 3D points (the head and tail of the vector).

Parameters
ax_3dAxes3D

Instance of Axes3D.

pointarray_like, optional

Position of the vector tail (default is origin).

scalar{int, float}, optional

Value used to scale the vector (default 1).

kwargsdict, optional

Additional keywords passed to plot().

Examples

>>> import matplotlib.pyplot as plt
>>> from mpl_toolkits.mplot3d import Axes3D
>>> from skspatial.objects import Vector
>>> fig = plt.figure()
>>> ax = fig.add_subplot(111, projection='3d')
>>> Vector([-1, 1, 1]).plot_3d(ax, point=(1, 2, 3), c='r')

(Source code, png, hires.png, pdf)

../../../_images/skspatial-objects-Vector-plot_3d-1.png