import matplotlib as mpl
from matplotlib.patches import PathPatch
from matplotlib import pyplot as plt
import numpy as np
from snippets.plot import rounded_path

fig, ax = plt.subplots()
lines = [
    [(0, 0), (0, 1), (1, 1), (2, 0), (1.9, 0), (1, 0.5)],
    [(1.5, 1), (2, 1)],
    [(0, 1.5), (1, 2), (2, 1.5)],
]
for i, line in enumerate(lines):
    color = f"C{i}"
    ax.plot(*np.transpose(line), marker="o", ls="--", color=color)
    path = rounded_path(line, 0.2, 0.1)
    patch = PathPatch(path, lw=5, fc="none", ec=color, alpha=0.5)
    ax.add_patch(patch)
ax.set_aspect("equal")
fig.tight_layout()