def image_function(f='<STR_LIT>', xmin=-<NUM_LIT:1>, xmax=<NUM_LIT:1>, ymin=-<NUM_LIT:1>, ymax=<NUM_LIT:1>, xsteps=<NUM_LIT:100>, ysteps=<NUM_LIT:100>, p='<STR_LIT>', g=None, **kwargs):
default_kwargs = dict(clabel=str(f), xlabel='<STR_LIT:x>', ylabel='<STR_LIT:y>')<EOL>default_kwargs.update(kwargs)<EOL>if not g: g = {}<EOL>for k in list(globals().keys()):<EOL><INDENT>if k not in g: g[k] = globals()[k]<EOL><DEDENT>if type(f) == str:<EOL><INDENT>f = eval('<STR_LIT>' + p + '<STR_LIT>' + f, g)<EOL><DEDENT>xones = _n.linspace(<NUM_LIT:1>,<NUM_LIT:1>,ysteps)<EOL>x     = _n.linspace(xmin, xmax, xsteps)<EOL>xgrid = _n.outer(xones, x)<EOL>yones = _n.linspace(<NUM_LIT:1>,<NUM_LIT:1>,xsteps)<EOL>y     = _n.linspace(ymin, ymax, ysteps)<EOL>ygrid = _n.outer(y, yones)<EOL>try:<EOL><INDENT>zgrid = f(xgrid, ygrid) + xgrid*<NUM_LIT:0.0><EOL><DEDENT>except:<EOL><INDENT>print("<STR_LIT>")<EOL>zgrid = []<EOL>for ny in range(<NUM_LIT:0>, len(y)):<EOL><INDENT>zgrid.append([])<EOL>for nx in range(<NUM_LIT:0>, len(x)):<EOL><INDENT>zgrid[ny].append(f(x[nx], y[ny]))<EOL><DEDENT><DEDENT>zgrid = _n.array(zgrid)<EOL><DEDENT>image_data(zgrid.transpose(), x, y, **default_kwargs)<EOL>
Plots a 2-d function over the specified range

Parameters
----------
f='sin(5*x)*cos(5*y)'                   
    Takes two inputs and returns one value. Can also
    be a string function such as sin(x*y)
xmin=-1, xmax=1, ymin=-1, ymax=1     
    Range over which to generate/plot the data
xsteps=100, ysteps=100
    How many points to plot on the specified range
p='x,y'
    If using strings for functions, this is a string of parameters.
g=None
    Optional additional globals. Try g=globals()!

See spinmob.plot.image.data() for additional optional keyword arguments.