skspatial.objects.LineSegment.plot_3d

LineSegment.plot_3d(ax_3d: Axes3D, **kwargs) None[source]

Plot a 3D line segment.

The line segment is plotted by connecting two 3D points.

Parameters
ax_3dAxes3D

Instance of Axes3D.

kwargsdict, optional

Additional keywords passed to plot().

Examples

>>> import matplotlib.pyplot as plt
>>> from mpl_toolkits.mplot3d import Axes3D
>>> from skspatial.objects import LineSegment
>>> fig = plt.figure()
>>> ax = fig.add_subplot(111, projection='3d')
>>> segment = LineSegment([1, 2, 3], [0, 1, 1])
>>> segment.point_a.plot_3d(ax, c='b', s=100, zorder=3)
>>> segment.point_b.plot_3d(ax, c='r', s=100, zorder=3)
>>> segment.plot_3d(ax, c='k')

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

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