mrdja.matplot3d.draw_segment

mrdja.matplot3d.draw_segment(line: ndarray, color: str = 'red', style: str = '-', ax=None)[source]

Draws a line in 3D space.

Parameters:
  • segment (numpy.ndarray) – A 2x3 numpy array containing the endpoints of the segment.

  • color (str) – The color of the segment to draw.

  • style (str) – The style of the segment to draw.

  • ax (matplotlib.axes._subplots.Axes3DSubplot) – The matplotlib ax object to draw on.

Returns:

The ax object.

Return type:

matplotlib.axes._subplots.Axes3DSubplot

Example:

>>> import mrdja.matplot3d as plt3d
>>> import numpy as np
>>> segment = np.array([[0, 0, 0], [1, 1, 1]])
>>> plt3d.draw_segment(segment, color="blue", style="--")

matplot3d_draw_segment_example