(f, *var_args)
Samples a 2d or 3d function over specified intervals and returns
    a dataset suitable for plotting with matlab (matplotlib) syntax.
    Wrapper for sample2d and sample3d.

    f is a function of one or two variables, such as x**2.
    var_args are intervals for each variable given in the form (var, min, max, n)
Samples a 2d or 3d function over specified intervals and returns
    a dataset suitable for plotting with matlab (matplotlib) syntax.
    Wrapper for sample2d and sample3d.
Samples a 2d or 3d function over specified intervals and returns a dataset suitable for plotting with matlab ( matplotlib ) syntax . Wrapper for sample2d and sample3d .
def sample(f, *var_args):
    """
    Samples a 2d or 3d function over specified intervals and returns
    a dataset suitable for plotting with matlab (matplotlib) syntax.
    Wrapper for sample2d and sample3d.

    f is a function of one or two variables, such as x**2.
    var_args are intervals for each variable given in the form (var, min, max, n)
    """
    if len(var_args) == 1:
        return sample2d(f, var_args[0])
    elif len(var_args) == 2:
        return sample3d(f, var_args[0], var_args[1])
    else:
        raise ValueError("Only 2d and 3d sampling are supported at this time.")
def sample ( f , * var_args ) : if len ( var_args ) == 1 : return sample2d ( f , var_args [ 0 ] ) elif len ( var_args ) == 2 : return sample3d ( f , var_args [ 0 ] , var_args [ 1 ] ) else : raise ValueError ( "Only 2d and 3d sampling are supported at this time." )