MCPcopy Create free account
hub / github.com/Rex-sys-hk/PlanScope / plot_direction

Function plot_direction

src/utils/vis.py:215–229  ·  view source on GitHub ↗
(ax, anchors, dir_vecs, zorder=1)

Source from the content-addressed store, hash-verified

213
214
215def plot_direction(ax, anchors, dir_vecs, zorder=1):
216 for anchor, dir_vec in zip(anchors, dir_vecs):
217 if np.linalg.norm(dir_vec) == 0:
218 continue
219 vec = dir_vec / np.linalg.norm(dir_vec)
220 ax.arrow(
221 anchor[0],
222 anchor[1],
223 vec[0],
224 vec[1],
225 color="black",
226 zorder=zorder,
227 head_width=0.2,
228 head_length=0.2,
229 )
230
231
232def plot_trajectory_with_angle(ax, traj):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected