(self, *args, **kwds)
Centers the layout around the given point.

        The point itself can be supplied as multiple unnamed arguments, as a
        simple unnamed list or as a keyword argument. This operation moves
        the centroid of the layout to the given point. If no point is supplied,
        defaults to the origin of the coordinate system.

        @keyword p: the point where the centroid of the layout will be after
          the operation.
Centers the layout around the given point.
Centers the layout around the given point .
def center(self, *args, **kwds):
        """Centers the layout around the given point.

        The point itself can be supplied as multiple unnamed arguments, as a
        simple unnamed list or as a keyword argument. This operation moves
        the centroid of the layout to the given point. If no point is supplied,
        defaults to the origin of the coordinate system.

        @keyword p: the point where the centroid of the layout will be after
          the operation."""
        center = kwds.get("p") or args
        if len(center) == 0:
            center = [0.0] * self._dim
        elif len(center) == 1 and type(center[0]) != int and type(center[0]) != float:
            center = center[0]
        if len(center) != self._dim:
            raise ValueError("the given point must have %d dimensions" % self._dim)
        centroid = self.centroid()
        vec = [center[d] - centroid[d] for d in range(self._dim)]
        self.translate(vec)
def center ( self , * args , * * kwds ) : center = kwds . get ( "p" ) or args if len ( center ) == 0 : center = [ 0.0 ] * self . _dim elif len ( center ) == 1 and type ( center [ 0 ] ) != int and type ( center [ 0 ] ) != float : center = center [ 0 ] if len ( center ) != self . _dim : raise ValueError ( "the given point must have %d dimensions" % self . _dim ) centroid = self . centroid ( ) vec = [ center [ d ] - centroid [ d ] for d in range ( self . _dim ) ] self . translate ( vec )