differt.plotting.draw_paths#
- draw_paths(paths, **kwargs)[source]#
Plot a batch of paths of the same length.
- Parameters:
paths (
Real[ArrayLike, '*batch path_length 3']) – The array of path vertices.kwargs (
Any) – Keyword arguments passed toLinePlot,plot, orScatter3d, depending on the backend.
- Return type:
- Returns:
The resulting plot output.
Examples
The following example shows how to plot ten line strings.
>>> from differt.geometry import rotation_matrix_along_z_axis as rot >>> from differt.plotting import draw_paths >>> >>> path = np.array( ... [ ... [0.0, 0.0, 0.0], ... [1.0, 0.0, 0.0], ... [1.0, 1.0, 0.0], ... [0.1, 0.1, 0.0], ... ], ... ) >>> paths = np.stack([ ... path @ rot(angle) + np.array([0.0, 0.0, 0.1 * dz]) ... for dz, angle in enumerate(np.linspace(0, 2 * np.pi, 10)) ... ]) >>> fig = draw_paths( ... paths, ... backend="plotly", ... line=dict(color="black", width=3), ... ) >>> fig