Skip to content

Instantly share code, notes, and snippets.

View dhyanKaro's full-sized avatar

dhyanKaro

View GitHub Profile
@dhyanKaro
dhyanKaro / matplotlib_arrow_text_boxes.py
Created January 3, 2024 16:26
Directional Arrow Callout Annotations in Matplotlib
"""
This script draws arrows pointing in four directions from a text box using matplotlib.
"""
import matplotlib.pyplot as plt
from matplotlib.patches import FancyArrow
from matplotlib.text import Text
def draw_arrow(ax, x, y, txt, direction, length, width):
"""