(self, *args, **kwds)
Scales the layout.

        Scaling parameters can be provided either through the C{scale} keyword
        argument or through plain unnamed arguments. If a single integer or
        float is given, it is interpreted as a uniform multiplier to be applied
        on all dimensions. If it is a list or tuple, its length must be equal to
        the number of dimensions in the layout, and each element must be an
        integer or float describing the scaling coefficient in one of the
        dimensions.

        @keyword scale: scaling coefficients (integer, float, list or tuple)
        @keyword origin: the origin of scaling (this point will stay in place).
          Optional, defaults to the origin of the coordinate system being used.
Scales the layout.
Scales the layout .
def scale(self, *args, **kwds):
        """Scales the layout.

        Scaling parameters can be provided either through the C{scale} keyword
        argument or through plain unnamed arguments. If a single integer or
        float is given, it is interpreted as a uniform multiplier to be applied
        on all dimensions. If it is a list or tuple, its length must be equal to
        the number of dimensions in the layout, and each element must be an
        integer or float describing the scaling coefficient in one of the
        dimensions.

        @keyword scale: scaling coefficients (integer, float, list or tuple)
        @keyword origin: the origin of scaling (this point will stay in place).
          Optional, defaults to the origin of the coordinate system being used.
        """
        origin = list(kwds.get("origin", [0.0] * self._dim))
        if len(origin) != self._dim:
            raise ValueError("origin must have %d dimensions" % self._dim)

        scaling = kwds.get("scale") or args
        if isinstance(scaling, (int, float)):
            scaling = [scaling]
        if len(scaling) == 0:
            raise ValueError("scaling factor must be given")
        elif len(scaling) == 1:
            if type(scaling[0]) == int or type(scaling[0]) == float:
                scaling *= self._dim
            else:
                scaling = scaling[0]
        if len(scaling) != self._dim:
            raise ValueError("scaling factor list must have %d elements" % self._dim)

        for idx, row in enumerate(self._coords):
            self._coords[idx] = [
                (row[d] - origin[d]) * scaling[d] + origin[d] for d in range(self._dim)
            ]
def scale ( self , * args , * * kwds ) : origin = list ( kwds . get ( "origin" , [ 0.0 ] * self . _dim ) ) if len ( origin ) != self . _dim : raise ValueError ( "origin must have %d dimensions" % self . _dim ) scaling = kwds . get ( "scale" ) or args if isinstance ( scaling , ( int , float ) ) : scaling = [ scaling ] if len ( scaling ) == 0 : raise ValueError ( "scaling factor must be given" ) elif len ( scaling ) == 1 : if type ( scaling [ 0 ] ) == int or type ( scaling [ 0 ] ) == float : scaling *= self . _dim else : scaling = scaling [ 0 ] if len ( scaling ) != self . _dim : raise ValueError ( "scaling factor list must have %d elements" % self . _dim ) for idx , row in enumerate ( self . _coords ) : self . _coords [ idx ] = [ ( row [ d ] - origin [ d ] ) * scaling [ d ] + origin [ d ] for d in range ( self . _dim ) ]