def plot_signal_sum(ax, params, fname='<STR_LIT>', unit='<STR_LIT>', scaling_factor=<NUM_LIT:1.>,<EOL>ylabels=True, scalebar=True, vlimround=None,<EOL>T=[<NUM_LIT>, <NUM_LIT:1000>], ylim=[-<NUM_LIT>, <NUM_LIT:0>], color='<STR_LIT:k>', fancy=False,<EOL>label='<STR_LIT>', transient=<NUM_LIT:200>, clip_on=False, rasterized=True,<EOL>**kwargs):
if type(fname) == str and os.path.isfile(fname):<EOL><INDENT>f = h5py.File(fname)<EOL>data = f['<STR_LIT:data>'].value<EOL>tvec = np.arange(data.shape[<NUM_LIT:1>]) * <NUM_LIT> / f['<STR_LIT>'].value    <EOL>datameanaxis1 = f['<STR_LIT:data>'].value[:, tvec >= transient].mean(axis=<NUM_LIT:1>)<EOL>f.close()<EOL><DEDENT>elif type(fname) == np.ndarray and fname.ndim==<NUM_LIT:2>:<EOL><INDENT>data = fname<EOL>tvec = np.arange(data.shape[<NUM_LIT:1>]) * params.dt_output<EOL>datameanaxis1 = data[:, tvec >= transient].mean(axis=<NUM_LIT:1>)<EOL><DEDENT>else:<EOL><INDENT>raise Exception('<STR_LIT>'.format(type(fname)))<EOL><DEDENT>slica = (tvec <= T[<NUM_LIT:1>]) & (tvec >= T[<NUM_LIT:0>])<EOL>data = data[:,slica]<EOL>dataT = data.T - datameanaxis1<EOL>data = dataT.T<EOL>data = data*scaling_factor<EOL>zvec = np.r_[params.electrodeParams['<STR_LIT:z>']]<EOL>zvec = np.r_[zvec, zvec[-<NUM_LIT:1>] + np.diff(zvec)[-<NUM_LIT:1>]]<EOL>vlim = abs(data).max()<EOL>if vlimround is None:<EOL><INDENT>vlimround = <NUM_LIT>**np.round(np.log2(vlim))<EOL><DEDENT>else:<EOL><INDENT>pass<EOL><DEDENT>yticklabels=[]<EOL>yticks = []<EOL>if fancy:<EOL><INDENT>colors=phlp.get_colors(data.shape[<NUM_LIT:0>])<EOL><DEDENT>else:<EOL><INDENT>colors = [color]*data.shape[<NUM_LIT:0>]<EOL><DEDENT>for i, z in enumerate(params.electrodeParams['<STR_LIT:z>']):<EOL><INDENT>if i == <NUM_LIT:0>:<EOL><INDENT>ax.plot(tvec[slica], data[i] * <NUM_LIT:100> / vlimround + z,<EOL>color=colors[i], rasterized=rasterized, label=label,<EOL>clip_on=clip_on, **kwargs)<EOL><DEDENT>else: <EOL><INDENT>ax.plot(tvec[slica], data[i] * <NUM_LIT:100> / vlimround + z,<EOL>color=colors[i], rasterized=rasterized, clip_on=clip_on,<EOL>**kwargs)<EOL><DEDENT>yticklabels.append('<STR_LIT>' % (i+<NUM_LIT:1>))<EOL>yticks.append(z)<EOL><DEDENT>if scalebar:<EOL><INDENT>ax.plot([tvec[slica][-<NUM_LIT:1>], tvec[slica][-<NUM_LIT:1>]],<EOL>[-<NUM_LIT>, -<NUM_LIT>], lw=<NUM_LIT:2>, color='<STR_LIT:k>', clip_on=False)<EOL>ax.text(tvec[slica][-<NUM_LIT:1>]+np.diff(T)*<NUM_LIT>, -<NUM_LIT>,<EOL>r'<STR_LIT>' % (vlimround, unit),<EOL>color='<STR_LIT:k>', rotation='<STR_LIT>',<EOL>va='<STR_LIT>')<EOL><DEDENT>ax.axis(ax.axis('<STR_LIT>'))<EOL>ax.yaxis.set_ticks(yticks)<EOL>if ylabels:<EOL><INDENT>ax.yaxis.set_ticklabels(yticklabels)<EOL><DEDENT>else:<EOL><INDENT>ax.yaxis.set_ticklabels([])<EOL><DEDENT>for loc, spine in ax.spines.items():<EOL><INDENT>if loc in ['<STR_LIT:right>', '<STR_LIT>']:<EOL><INDENT>spine.set_color('<STR_LIT:none>')            <EOL><DEDENT><DEDENT>ax.xaxis.set_ticks_position('<STR_LIT>')<EOL>ax.yaxis.set_ticks_position('<STR_LIT:left>')<EOL>ax.set_xlabel(r'<STR_LIT>', labelpad=<NUM_LIT:0.1>)<EOL>ax.set_ylim(ylim)<EOL>return vlimround<EOL>
on axes plot the summed LFP contributions

args:
::

    ax : matplotlib.axes.AxesSubplot object
    fname : str/np.ndarray, path to h5 file or ndim=2 numpy.ndarray 
    unit : str, scalebar unit
    scaling_factor : float, scaling factor (e.g. to scale 10% data set up)
    ylabels : bool, show labels on y-axis
    scalebar : bool, show scalebar in plot
    vlimround : None/float, override autoscaling of data and scalebar
    T : list, [tstart, tstop], which timeinterval
    ylim : list of floats, see plt.gca().set_ylim
    color : str/colorspec tuple, color of shown lines
    fancy : bool,
    label : str, line labels
    rasterized : bool, rasterize line plots if true
    kwargs : additional keyword arguments passed to ax.plot()


returns:
::

    vlimround : float, scalebar scaling factor, i.e., to match up plots