def plotting_correlation(params, x0, x1, ax, lag=<NUM_LIT>, scaling=None, normalize=True,<EOL>color='<STR_LIT:k>', unit=r'<STR_LIT>' , title='<STR_LIT>',<EOL>scalebar=True, **kwargs):
zvec = np.r_[params.electrodeParams['<STR_LIT:z>']]<EOL>zvec = np.r_[zvec, zvec[-<NUM_LIT:1>] + np.diff(zvec)[-<NUM_LIT:1>]]<EOL>xcorr_all=np.zeros((params.electrodeParams['<STR_LIT:z>'].size, x0.shape[-<NUM_LIT:1>]))<EOL>if normalize:<EOL><INDENT>for i, z in enumerate(params.electrodeParams['<STR_LIT:z>']):<EOL><INDENT>if x0.ndim == <NUM_LIT:1>:<EOL><INDENT>x2 = x1[i, ]<EOL>xcorr1 = np.correlate(helpers.normalize(x0),<EOL>helpers.normalize(x2), '<STR_LIT>') / x0.size<EOL><DEDENT>elif x0.ndim == <NUM_LIT:2>:<EOL><INDENT>xcorr1 = np.correlate(helpers.normalize(x0[i, ]),<EOL>helpers.normalize(x1[i, ]), '<STR_LIT>') / x0.shape[-<NUM_LIT:1>]<EOL><DEDENT>xcorr_all[i,:]=xcorr1<EOL><DEDENT><DEDENT>else:<EOL><INDENT>for i, z in enumerate(params.electrodeParams['<STR_LIT:z>']):<EOL><INDENT>if x0.ndim == <NUM_LIT:1>:<EOL><INDENT>x2 = x1[i, ]<EOL>xcorr1 = np.correlate(x0,x2, '<STR_LIT>')<EOL><DEDENT>elif x0.ndim == <NUM_LIT:2>:<EOL><INDENT>xcorr1 = np.correlate(x0[i, ],x1[i, ], '<STR_LIT>')<EOL><DEDENT>xcorr_all[i,:]=xcorr1<EOL><DEDENT><DEDENT>if scaling is None:<EOL><INDENT>vlim = abs(xcorr_all).max()<EOL>vlimround = <NUM_LIT>**np.round(np.log2(vlim))<EOL><DEDENT>else:<EOL><INDENT>vlimround = scaling<EOL><DEDENT>yticklabels=[]<EOL>yticks = []<EOL>lagvector = np.arange(-lag, lag+<NUM_LIT:1>).astype(int)<EOL>inds = lagvector + x0.shape[-<NUM_LIT:1>] / <NUM_LIT:2><EOL>for i, z in enumerate(params.electrodeParams['<STR_LIT:z>']):<EOL><INDENT>ax.plot(lagvector, xcorr_all[i,inds[::-<NUM_LIT:1>]] * <NUM_LIT> / vlimround + z, '<STR_LIT:k>',<EOL>clip_on=True, rasterized=False, color=color, **kwargs)<EOL>yticklabels.append('<STR_LIT>' %(i+<NUM_LIT:1>))<EOL>yticks.append(z)    <EOL><DEDENT>phlp.remove_axis_junk(ax)<EOL>ax.set_title(title, va='<STR_LIT>')<EOL>ax.set_xlabel(r'<STR_LIT>', labelpad=<NUM_LIT:0.1>)<EOL>ax.set_xlim(-lag, lag)<EOL>ax.set_ylim(z-<NUM_LIT:100>, <NUM_LIT:100>)<EOL>axis = ax.axis()<EOL>ax.vlines(<NUM_LIT:0>, axis[<NUM_LIT:2>], axis[<NUM_LIT:3>], '<STR_LIT:k>' if analysis_params.bw else '<STR_LIT:k>', '<STR_LIT>', lw=<NUM_LIT>)<EOL>ax.yaxis.set_ticks(yticks)<EOL>ax.yaxis.set_ticklabels(yticklabels)<EOL>ax.xaxis.set_ticks_position('<STR_LIT>')<EOL>ax.yaxis.set_ticks_position('<STR_LIT:left>')<EOL>if scalebar:<EOL><INDENT>ax.plot([lag, lag],<EOL>[-<NUM_LIT>, -<NUM_LIT>], lw=<NUM_LIT:2>, color='<STR_LIT:k>', clip_on=False)<EOL>ax.text(lag*<NUM_LIT>, -<NUM_LIT>, unit % vlimround,<EOL>rotation='<STR_LIT>', va='<STR_LIT>')<EOL><DEDENT>return xcorr_all[:, inds[::-<NUM_LIT:1>]], vlimround<EOL>
mls
    on axes plot the correlation between x0 and x1

    args:
    ::
        x0 : first dataset
        x1 : second dataset - the LFP usually here
        ax : matplotlib.axes.AxesSubplot object
        title : text to be used as current axis object title
        normalize : if True, signals are z-scored before applying np.correlate
        unit : unit for scalebar