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