(self, angle, dim1=0, dim2=1, **kwds)
Rotates the layout by the given degrees on the plane defined by
        the given two dimensions.

        @param angle: the angle of the rotation, specified in degrees.
        @param dim1: the first axis of the plane of the rotation.
        @param dim2: the second axis of the plane of the rotation.
        @keyword origin: the origin of the rotation. If not specified, the
          origin will be the origin of the coordinate system.
Rotates the layout by the given degrees on the plane defined by
        the given two dimensions.
Rotates the layout by the given degrees on the plane defined by the given two dimensions .
def rotate(self, angle, dim1=0, dim2=1, **kwds):
        """Rotates the layout by the given degrees on the plane defined by
        the given two dimensions.

        @param angle: the angle of the rotation, specified in degrees.
        @param dim1: the first axis of the plane of the rotation.
        @param dim2: the second axis of the plane of the rotation.
        @keyword origin: the origin of the rotation. If not specified, the
          origin will be the origin of the coordinate system.
        """

        origin = list(kwds.get("origin", [0.0] * self._dim))
        if len(origin) != self._dim:
            raise ValueError("origin must have %d dimensions" % self._dim)

        radian = angle * pi / 180.0
        cos_alpha, sin_alpha = cos(radian), sin(radian)

        for idx, row in enumerate(self._coords):
            x, y = row[dim1] - origin[dim1], row[dim2] - origin[dim2]
            row[dim1] = cos_alpha * x - sin_alpha * y + origin[dim1]
            row[dim2] = sin_alpha * x + cos_alpha * y + origin[dim2]
def rotate ( self , angle , dim1 = 0 , dim2 = 1 , * * kwds ) : origin = list ( kwds . get ( "origin" , [ 0.0 ] * self . _dim ) ) if len ( origin ) != self . _dim : raise ValueError ( "origin must have %d dimensions" % self . _dim ) radian = angle * pi / 180.0 cos_alpha , sin_alpha = cos ( radian ) , sin ( radian ) for idx , row in enumerate ( self . _coords ) : x , y = row [ dim1 ] - origin [ dim1 ] , row [ dim2 ] - origin [ dim2 ] row [ dim1 ] = cos_alpha * x - sin_alpha * y + origin [ dim1 ] row [ dim2 ] = sin_alpha * x + cos_alpha * y + origin [ dim2 ]