skspatial.objects.Triangle.plot_3d

Triangle.plot_3d(ax_3d: mpl_toolkits.mplot3d.axes3d.Axes3D, part: str = 'points', **kwargs: str) None[source]

Plot a triangle in 3D.

Parameters
ax_3dAxes3D

Instance of Axes3D.

partstr, optional

Part of the triangle to plot. Either ‘points’ or ‘lines’ (default ‘points’).

kwargsdict, optional

Additional keywords passed to plot_3d() or plot_3d().

Examples

>>> import matplotlib.pyplot as plt
>>> from skspatial.objects import Triangle
>>> triangle = Triangle([0, 0], [1, 0], [0, 1])
>>> _, ax = plt.subplots()
>>> triangle.plot_2d(ax, part='points', s=100, zorder=3)
>>> triangle.plot_2d(ax, part='lines', c='k')

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

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