def scale_y_universal(average=[<NUM_LIT:1>,<NUM_LIT:10>], axes="<STR_LIT>"):
if axes=="<STR_LIT>": axes = _pylab.gca()<EOL>lines = axes.get_lines()<EOL>for m in range(<NUM_LIT:0>,len(lines)):<EOL><INDENT>if isinstance(lines[m], _mpl.lines.Line2D):<EOL><INDENT>xdata = lines[m].get_xdata()<EOL>ydata = lines[m].get_ydata()<EOL>s=<NUM_LIT:0><EOL>for n in range(average[<NUM_LIT:0>], average[<NUM_LIT:1>]+<NUM_LIT:1>): s += ydata[n]<EOL>scale = <NUM_LIT:1.0>*s/(average[<NUM_LIT:1>]-average[<NUM_LIT:0>]+<NUM_LIT:1.0>)<EOL>for n in range(<NUM_LIT:0>,len(ydata)): ydata[n] = ydata[n]/scale<EOL>lines[m].set_data(xdata, ydata)<EOL><DEDENT><DEDENT>title = axes.title.get_text()<EOL>title += "<STR_LIT>"<EOL>axes.title.set_text(title)<EOL>auto_zoom()<EOL>
This function scales lines vertically.

average=[1,10]    indices of average universal point