def magphase_data(xdata, ydata, eydata=None, exdata=None, xscale='<STR_LIT>', mscale='<STR_LIT>', pscale='<STR_LIT>', mlabel='<STR_LIT>', plabel='<STR_LIT>', phase='<STR_LIT>', figure='<STR_LIT>', clear=<NUM_LIT:1>, draw=True,  **kwargs):
_pylab.ioff()<EOL>if figure == '<STR_LIT>': f = _pylab.gcf()<EOL>if clear: f.clear()<EOL>axes1 = _pylab.subplot(<NUM_LIT>)<EOL>axes2 = _pylab.subplot(<NUM_LIT>,sharex=axes1)<EOL>xdata, ydata = _match_data_sets(xdata, ydata)<EOL>exdata = _match_error_to_data_set(xdata, exdata)<EOL>eydata = _match_error_to_data_set(ydata, eydata)<EOL>m  = []<EOL>p  = []<EOL>em = []<EOL>ep = []<EOL>for l in range(len(ydata)):<EOL><INDENT>m.append(_n.abs(ydata[l]))<EOL>p.append(_n.angle(ydata[l]))<EOL>if eydata[l] is None:<EOL><INDENT>em.append(None)<EOL>ep.append(None)<EOL><DEDENT>else:<EOL><INDENT>er = _n.real(eydata[l])<EOL>ei = _n.imag(eydata[l])<EOL>em.append(<NUM_LIT:0.5>*((er+ei) + (er-ei)*_n.cos(p[l]))      )<EOL>ep.append(<NUM_LIT:0.5>*((er+ei) - (er-ei)*_n.cos(p[l]))/m[l] )<EOL><DEDENT>if phase=='<STR_LIT>': <EOL><INDENT>p[-<NUM_LIT:1>] = p[-<NUM_LIT:1>]*<NUM_LIT>/_n.pi<EOL>if not ep[l] is None: <EOL><INDENT>ep[l] = ep[l]*<NUM_LIT>/_n.pi<EOL><DEDENT><DEDENT><DEDENT>if phase=='<STR_LIT>':         plabel = plabel + "<STR_LIT>"<EOL>else:                        plabel = plabel + "<STR_LIT>"<EOL>if '<STR_LIT>' in kwargs: xlabel=kwargs.pop('<STR_LIT>')<EOL>else:                        xlabel='<STR_LIT>'<EOL>if '<STR_LIT>' in kwargs: kwargs.pop('<STR_LIT>')<EOL>if '<STR_LIT>' not in kwargs: kwargs['<STR_LIT>'] = True<EOL>autoformat = kwargs['<STR_LIT>']<EOL>kwargs['<STR_LIT>'] = False<EOL>kwargs['<STR_LIT>'] = '<STR_LIT>'<EOL>xy_data(xdata, m, em, exdata, ylabel=mlabel, axes=axes1, clear=<NUM_LIT:0>, xscale=xscale, yscale=mscale, draw=False, **kwargs)<EOL>kwargs['<STR_LIT>'] = autoformat<EOL>kwargs['<STR_LIT>'] = xlabel<EOL>xy_data(xdata, p, ep, exdata, ylabel=plabel, axes=axes2, clear=<NUM_LIT:0>, xscale=xscale, yscale=pscale, draw=False, **kwargs)<EOL>axes2.set_title('<STR_LIT>')<EOL>if draw:<EOL><INDENT>_pylab.ion()<EOL>_pylab.draw()<EOL>_pylab.show()<EOL><DEDENT>
Plots the magnitude and phase of complex ydata vs xdata.

Parameters
----------
xdata               
    Real-valued x-axis data
ydata               
    Complex-valued y-axis data
eydata=None         
    Complex-valued y-error
exdata=None         
    Real-valued x-error
xscale='linear'     
    'log' or 'linear' scale of the x axis
mscale='linear'     
    'log' or 'linear' scale of the magnitude axis
pscale='linear'     
    'log' or 'linear' scale of the phase axis
mlabel='Magnitude'  
    y-axis label for magnitude plot
plabel='Phase'      
    y-axis label for phase plot
phase='degrees'     
    'degrees' or 'radians' for the phase axis
figure='gcf'        
    Plot on the specified figure instance or 'gcf' for current figure.
clear=1             
    Clear the figure?
draw=True
    Draw the figure when complete?

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