mpl-draggable-line’s Documentation#

Draggable Line Widget for Matplotlib

a line being dragged around in an empty plot

Install#

pip install mpl-draggable-line

Basic Usage#

# for when running in a notebook
%matplotlib widget 

import matplotlib.pyplot as plt
from mpl_draggable_line import DraggableLine
fig, ax = plt.subplots()

init_x = [0.25, 0.5]
init_y = [0.25, 0.5]

dl = DraggableLine(ax, init_x, init_y)
plt.show(block=False)