def scaling(numcharts, currentn, indent, yscale):
    """Return origin and scale GPL
    numcharts is the number of charts in this row
    currentn is the current chart number counting from zero
    indent is the indentation for the first chart in a row
    yscale is the percentage in the y dimension
    
    Assumes that this function is not called if only one chart per row
    and indent and yscale parameters are already validated."""
    
    xscale = (100. - indent) / numcharts
    xorigin = indent + (currentn * xscale)
    res = "origin(%(xorigin)s%%, 0%%), scale(%(xscale)s%%, %(yscale)s%%)" % locals()
    return res