anyplotlib.ArrowWidget#

class anyplotlib.ArrowWidget(push_fn, *, x, y, u, v, color='#00e5ff', linewidth=2, show_handles=True)[source]#

Bases: Widget

Draggable arrow overlay widget for 2-D plots.

The arrow tail sits at (x, y) and the head at (x + u, y + v), all in image-pixel coordinates. Dragging the body moves the whole arrow; dragging the head handle re-aims it (updates u/v).

Parameters:
  • push_fn (Callable) – Update callback.

  • x (float) – Tail position in pixel/data coordinates.

  • y (float) – Tail position in pixel/data coordinates.

  • u (float) – Arrow vector (head = tail + (u, v)) in pixel/data coordinates.

  • v (float) – Arrow vector (head = tail + (u, v)) in pixel/data coordinates.

  • color (str, optional) – CSS colour for the arrow. Default "#00e5ff".

  • linewidth (float, optional) – Shaft line width in px. Default 2.

  • show_handles (bool, optional) – Draw the tail/head grab handles. Default True.