def plot(self):
import pylab as pl
ax = pl.gca()
pl.hlines(self.tops, self.left, self.right, linestyles='dashed', colors='blue')
pl.hlines(self.tops + self.heights, self.left, self.right, linestyles='dashed', colors='green')
pl.vlines(self.lefts, self.top, self.bottom, linestyles='dashed', colors='blue')
pl.vlines(self.lefts + self.widths, self.top, self.bottom, linestyles='dashed', colors='green')
for box in self.rectangles:
t, l, b, r = box
patch = pl.Rectangle((l, t), r - l, b - t, color='blue', fill=True, alpha=0.5)
ax.add_patch(patch)
pass
评论列表
文章目录