Polygons#
Use the Polygons
tool to add closed polygons to a plot.
[1]:
%matplotlib widget
import matplotlib.pyplot as plt
import mpltoolbox as tbx
plt.ioff()
[1]:
<contextlib.ExitStack at 0x7fc16c7db760>
[2]:
fig, ax = plt.subplots(dpi=96)
ax.set_xlim(0, 100)
ax.set_ylim(0, 100)
polygons = tbx.Polygons(ax=ax)
[4]:
fig.canvas
[4]:
Controls
Left-click to make new polygon
Left-click and hold on polygon vertex to move vertex
Right-click and hold to drag/move the entire polygon
Middle-click (or Ctrl + left-click) to delete polygon