def function(f='<STR_LIT>', xmin=-<NUM_LIT:1>, xmax=<NUM_LIT:1>, steps=<NUM_LIT:200>, p='<STR_LIT:x>', g=None, erange=False, plotter=xy_data, complex_plane=False, **kwargs):
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 erange: x = _fun.erange(xmin, xmax, steps)<EOL>else:      x = _n.linspace(xmin, xmax, steps)<EOL>if not type(f) in [type([]), type(())]: f = [f]<EOL>xdatas = []<EOL>ydatas = []<EOL>labels = []<EOL>for fs in f:<EOL><INDENT>if type(fs) == str:<EOL><INDENT>a = eval('<STR_LIT>' + p + '<STR_LIT>' + fs, g)<EOL>a.__name__ = fs<EOL><DEDENT>else:<EOL><INDENT>a = fs<EOL><DEDENT>try: y = a(x)<EOL>except:<EOL><INDENT>y = []<EOL>for z in x: y.append(a(z))<EOL><DEDENT>xdatas.append(x)<EOL>ydatas.append(y)<EOL>labels.append(a.__name__)<EOL><DEDENT>if '<STR_LIT>' not in kwargs: kwargs['<STR_LIT>'] = p<EOL>if '<STR_LIT:label>' not in kwargs:  kwargs['<STR_LIT:label>']  = labels<EOL>if complex_plane: plotter(_n.real(ydatas),_n.imag(ydatas), **kwargs)<EOL>else:             plotter(xdatas, ydatas, **kwargs)<EOL>
Plots the function over the specified range

f                   function or list of functions to plot; can be string functions
xmin, xmax, steps   range over which to plot, and how many points to plot
p                   if using strings for functions, p is the parameter name
g                   optional dictionary of extra globals. Try g=globals()
erange              Use exponential spacing of the x data?
plotter             function used to plot the generated data
complex_plane       plot imag versus real of f?

**kwargs are sent to spinmob.plot.real_imag.data()