Lines#

Use the Lines tool to add lines to a plot. The argument n should be used to set the number of vertices per line.

[1]:
%matplotlib widget
import matplotlib.pyplot as plt
import mpltoolbox as tbx

plt.ioff()
[1]:
<contextlib.ExitStack at 0x7f6f74dedf30>
[2]:
fig, ax = plt.subplots(dpi=96)

ax.set_xlim(0, 100)
ax.set_ylim(0, 100)

lines = tbx.Lines(ax=ax, n=2)
[4]:
fig.canvas
[4]:

Controls

  • Left-click to make new lines

  • Left-click and hold on line vertex to move vertex

  • Right-click and hold to drag/move the entire line

  • Middle-click (or Ctrl + left-click) to delete line