class Rect: def __init__(self, num, who, facecolor='#7777CC', sw_corner=(0.0, 0.0), height=0, width=0): self.num = num self.mL = who self.sw_corner = sw_corner self.height = height self.width = width self.rect = Cell(sw_corner, width, height, edgecolor='#000000', facecolor=facecolor) self.rect._loc = 'center' label = "{0}".format(who) self.rect.get_text().set_text(label) self.rect.set_gid(who) def get_patch(self): return self.rect
def __init__(self, num, who, facecolor='#7777CC', sw_corner=(0.0, 0.0), height=10.0, width=10.0): self.num = num # num is value (area of a rectangle) self.name = who self.sw_corner = sw_corner self.height = height self.width = width self.rect = Cell(sw_corner, width, height, edgecolor='#000000', facecolor=facecolor) self.rect._loc = 'center' # self.rect.angle = 45.0 label = "{0}".format(who) self.rect.get_text().set_text(label) self.rect.set_gid(who)
def __init__(self, *args, **kwargs): Cell.__init__(self, *args, **kwargs) self._text.set_clip_on(True)