import matplotlib.pyplot as plt
from regions import LinePixelRegion, PixCoord

fig, ax = plt.subplots()

start = PixCoord(x=5, y=8)
end = PixCoord(x=25, y=25)
reg = LinePixelRegion(start=start, end=end)
patch = reg.plot(ax=ax, color='red', lw=2, label='Line')

ax.legend(handles=(patch,), loc='upper center')
ax.set_xlim(0, 30)
ax.set_ylim(0, 30)
ax.set_aspect('equal')