def __init__(self): self.identity = mtransforms.IdentityTransform() self.identity2 = mtransforms.IdentityTransform() # Force use of the more complex composition. self.composite = mtransforms.CompositeGenericTransform( self.identity, self.identity2) # Check parent -> child links of TransformWrapper. self.wrapper = mtransforms.TransformWrapper(self.composite) # Check child -> parent links of TransformWrapper. self.composite2 = mtransforms.CompositeGenericTransform( self.wrapper, self.identity)
def plot(self, lines, colors=[0, 0, 0, 1], linestyles='solid', linewidths=1.0, owner=None): lc = mc.LineCollection(lines, colors=colors, linestyles=linestyles, linewidths=linewidths) self.plt.add_collection(lc) if owner: objectTrans = transforms.Affine2D(owner.transform) dataTrans = lc.get_transform() lc.set_transform( transforms.CompositeGenericTransform(objectTrans, dataTrans)) ObjectWidget(lc, owner, self)