Ejemplo n.º 1
0
def plot_run_analysis_standard2_heatmap(runnumber,
                                        analysis_name='coh',
                                        savefigure=True):
    """
    Plots a heatmap of coherence for given runnumber. Even though we can give other analysis_names,
    it probably doesn't generalize very well because of sns.heatmap(..., vmin=0, vmax=1, ...)
    :param runnumber:
    :param analysis_name:
    :param savefig:
    :return: fig
    """
    run_analysis_standard2_df = mlu.run_analysis_standard2_to_df(runnumber)
    run_settings_loops = mlu.get_run_loops(runnumber)
    sett = mlu.get_clean_settings(runnumber)['sett']

    if run_settings_loops[2]['name'] == 'g_syn_loop':
        region_from = run_settings_loops[2]['region_from']
        region_to = run_settings_loops[2]['region_to']
        fixed_conductance_ee = sett['g_syn_ee_r'][region_from, region_to]
        fixed_conductance_ei = sett['g_syn_ei_r'][region_from, region_to]

    analysis_df = run_analysis_standard2_df[analysis_name].unstack().transpose(
    )

    fig = plt.figure()
    ax = fig.add_subplot(111)

    sns.heatmap(analysis_df, vmin=0, vmax=1, cmap='inferno', ax=ax)

    # x-axis
    ax.set_xlabel(run_settings_loops[1]['name_readable'])
    label_idxs = range(0, len(run_settings_loops[1]['values_inhibitory']), 3)
    ax.set_xticks(label_idxs)
    ax.set_xticklabels(
        np.around(run_settings_loops[1]['values_inhibitory'][
            ax.get_xticks().astype(int)],
                  decimals=2))

    # y-axis
    ax.invert_yaxis()
    ax.set_ylabel(run_settings_loops[2]['name_readable'])
    ylabels = run_settings_loops[2]['values']
    ax.set_yticks(range(0, len(ylabels), 2))
    ax.set_yticklabels(ylabels[ax.get_yticks()], rotation=0)

    # The rest
    ax.set_title(
        f'Run{runnumber} - {mlu.analysis_standard2_names[analysis_name]}')

    plt.show()

    if savefigure:
        name = f'run{runnumber}_{analysis_name}.png'
        fig.savefig(os.path.join(settings.run_figures_dir(runnumber), name),
                    bbox_inches='tight',
                    pad_inches=0)
    return fig
Ejemplo n.º 2
0
def plot_spiketrain_histogram(runnumber,
                              l1,
                              l2,
                              savefigure=True,
                              findpeaks=True,
                              cwt_widths=np.arange(4, 25)):
    sett = mlu.get_clean_settings(runnumber)['sett']
    spikes_excitatory, spikes_inhibitory = mlu.get_spiketrains_df(
        runnumber, l1, l2)

    bins = np.linspace(start=0,
                       stop=sett['Ttot'],
                       num=int(sett['Ttot'] / sett['dthist'] + 1),
                       endpoint=True)

    region1_excitatory_spikes_binned, _ = np.histogram(
        spikes_excitatory[spikes_excitatory['region'] == 1]['t'], bins=bins)
    region2_excitatory_spikes_binned, _ = np.histogram(
        spikes_excitatory[spikes_excitatory['region'] == 2]['t'], bins=bins)

    fig, ax = plt.subplots(nrows=2, sharex=True, figsize=(40, 15))

    ax[0].bar(x=bins[:-1], height=region1_excitatory_spikes_binned[:])
    ax[1].bar(x=bins[:-1], height=region2_excitatory_spikes_binned[:])

    ax[1].invert_yaxis()

    if findpeaks:
        region1_peaks = scipy.signal.find_peaks_cwt(
            region1_excitatory_spikes_binned, widths=cwt_widths)
        region2_peaks = scipy.signal.find_peaks_cwt(
            region2_excitatory_spikes_binned, widths=cwt_widths)

        ax[0].vlines(region1_peaks * sett['dthist'], 0, 10, colors='k')
        ax[1].vlines(region2_peaks * sett['dthist'], 0, 10, colors='k')

    fig.subplots_adjust(wspace=0, hspace=0)

    ax[0].set_title(
        f"Run {runnumber}, loop1={l1}, loop2={l2} - $reg_1$ (upper) and $reg_2$ (lower) excitatory cell spike histograms"
    )

    fig.show()

    if savefigure:
        name = 'run{}_l1{}_l2{}_excitatory_histograms.png'.format(
            runnumber, l1, l2)
        fig.savefig(os.path.join(settings.run_figures_dir(runnumber), name),
                    bbox_inches='tight',
                    pad_inches=0)

    return fig
Ejemplo n.º 3
0
def plot_spiketrains_scatter_region(runnumber,
                                    l1,
                                    l2,
                                    region,
                                    savefigure=True):
    sett = mlu.get_clean_settings(runnumber)['sett']
    spikes_excitatory, spikes_inhibitory = mlu.get_spiketrains_df(
        runnumber, l1, l2)

    spikes_excitatory[
        'neuron_idx'] = spikes_excitatory['neuron_idx'] + sett['Ni']

    fig, ax = plt.subplots(figsize=(20, 7.5))

    sns.scatterplot(
        x='t',
        y='neuron_idx',
        color='blue',
        s=5,
        data=spikes_excitatory[spikes_excitatory['region'] == region],
        ax=ax,
        label='Pyramidal Cells')
    sns.scatterplot(
        x='t',
        y='neuron_idx',
        color='red',
        s=5,
        data=spikes_inhibitory[spikes_inhibitory['region'] == region],
        ax=ax,
        label='Interneurons')

    ax.set_ylabel('Neuron index')
    ax.set_xlabel('Time ($s$)')
    ax.legend(loc='upper right')

    fig.show()

    if savefigure:
        name = f'run{runnumber}_l1{l1}_l2{l2}_region{region}_spiketrains.png'
        fig.savefig(os.path.join(settings.run_figures_dir(runnumber), name),
                    bbox_inches='tight',
                    pad_inches=0)

    return fig
Ejemplo n.º 4
0
def plot_spiketrains_scatter(runnumber, l1, l2, savefigure=True, regions=None):
    sett = mlu.get_clean_settings(runnumber)['sett']
    spikes_excitatory, spikes_inhibitory = mlu.get_spiketrains_df(
        runnumber, l1, l2)

    if regions is None:
        regions = sorted(spikes_excitatory.region.unique().astype(int))

    spikes_excitatory[
        'neuron_idx'] = spikes_excitatory['neuron_idx'] + sett['Ni']

    fig, axes = plt.subplots(nrows=len(regions),
                             sharex=False,
                             figsize=(40, 15))

    for region, ax in zip(regions, axes):
        sns.scatterplot(
            x='t',
            y='neuron_idx',
            color='red',
            s=5,
            data=spikes_inhibitory[spikes_inhibitory['region'] == region],
            ax=ax)
        sns.scatterplot(
            x='t',
            y='neuron_idx',
            color='blue',
            s=5,
            data=spikes_excitatory[spikes_excitatory['region'] == region],
            ax=ax)

    fig.show()

    if savefigure:
        name = f'run{runnumber}_l1{l1}_l2{l2}_spiketrains.png'
        fig.savefig(os.path.join(settings.run_figures_dir(runnumber), name),
                    bbox_inches='tight',
                    pad_inches=0)

    return fig
Ejemplo n.º 5
0
def __figure_results_correlation_boxplots_prepare_df(runnumbers_sett):
    noisetypes = {1: "White", 2: "Brown", 3: "Pink"}

    corr_df2 = pd.DataFrame()

    for runnumbers in runnumbers_sett:
        for runnumber in runnumbers:
            sett = mlu.get_clean_settings(runnumber)['sett']
            feedback_conductance_ee = sett['g_syn_ee_r'][0, 1]
            feedback_conductance_ei = sett['g_syn_ei_r'][0, 1]
            noisetype = noisetypes[sett['noisetype']]
            noiseamp = sett['noiseamp']

            analysis_standard2_df = mlu.run_analysis_standard2_to_df(runnumber)

            correlations = mlu.get_max_correlations(runnumber)

            new = pd.DataFrame({
                'feedback':
                feedback_conductance_ei,
                'coh':
                analysis_standard2_df['coh'],
                'correlation':
                correlations[analysis_info2_name],
                'threshold':
                list(analysis_standard2_df['coh'] >= coherence_threshold),
                'Noiseseed':
                sett['noiseseed'],
                'noisetype':
                noisetype,
                'noiseamp':
                noiseamp
            })
            for col in correlations.columns:
                new[col] = correlations[col]

            corr_df2 = corr_df2.append(new)
    return corr_df2
def methods_analysis_spike_density_histogram(runnumber,
                                             l1,
                                             l2,
                                             region,
                                             start,
                                             stop,
                                             filename=None):
    sett = mlu.get_clean_settings(runnumber)['sett']
    spikes_excitatory, spikes_inhibitory = mlu.get_spiketrains_df(
        runnumber, l1, l2)

    spikes_excitatory[
        'neuron_idx'] = spikes_excitatory['neuron_idx'] + sett['Ni']

    # Filter for region
    spikes_excitatory = spikes_excitatory[spikes_excitatory['region'] ==
                                          region]
    spikes_inhibitory = spikes_inhibitory[spikes_inhibitory['region'] ==
                                          region]

    # Filter for start <= t <= end
    spikes_excitatory = spikes_excitatory[spikes_excitatory['t'] >= start]
    spikes_excitatory = spikes_excitatory[spikes_excitatory['t'] <= stop]

    spikes_inhibitory = spikes_inhibitory[spikes_inhibitory['t'] >= start]
    spikes_inhibitory = spikes_inhibitory[spikes_inhibitory['t'] <= stop]

    # Bin the spikes for histograms
    bins = np.linspace(start=start,
                       stop=stop,
                       num=int((stop - start) / sett['dthist'] + 1),
                       endpoint=True)
    excitatory_spikes_binned, _ = np.histogram(spikes_excitatory['t'],
                                               bins=bins)
    inhibitory_spikes_binned, _ = np.histogram(spikes_inhibitory['t'],
                                               bins=bins)

    excitatory_spikes_density = 1000 * 1 / (
        sett['dthist'] * sett['Ne']) * excitatory_spikes_binned
    inhibitory_spikes_density = 1000 * 1 / (
        sett['dthist'] * sett['Ni']) * inhibitory_spikes_binned

    fig, ax = plt.subplots(nrows=2, sharex=True, figsize=(10, 4.5))

    ax[0].bar(x=bins[:-1],
              height=excitatory_spikes_density,
              color='red',
              label='Pyramidal cells')
    ax[1].bar(x=bins[:-1],
              height=inhibitory_spikes_density,
              color='blue',
              label='Interneurons')

    handles = [
        mpatches.Patch(color='red', label='Pyramidal cells'),
        mpatches.Patch(color='blue', label='Interneurons')
    ]

    ax[0].legend(handles=handles, loc='upper right')

    ax[1].invert_yaxis()
    fig.subplots_adjust(wspace=0, hspace=0)

    ax[1].set_xlabel('Time t ($ms$)')
    ax[0].set_ylabel('Spikes/s')
    ax[1].set_ylabel('Spikes/s')

    # ax[0].set_title(
    #     f"Pyramidal cell (upper) and interneuron (lower) spike density plots")

    fig.show()

    ppc_value = mlu.run_analysis_standard_to_df(runnumber)[
        region - 1]['Phaselocke'][l1 - 1, l2 - 1]

    plu.save_figure(fig,
                    filename,
                    runnumbers=[runnumber],
                    l1=l1,
                    l2=l2,
                    region=region,
                    start=start,
                    stop=stop,
                    ppc_value=ppc_value)
def methods_analysis_spikes_scatterplot(runnumber,
                                        l1,
                                        l2,
                                        region,
                                        start,
                                        stop,
                                        filename=None):
    sett = mlu.get_clean_settings(runnumber)['sett']
    spikes_excitatory, spikes_inhibitory = mlu.get_spiketrains_df(
        runnumber, l1, l2)

    spikes_excitatory[
        'neuron_idx'] = spikes_excitatory['neuron_idx'] + sett['Ni']

    # Filter for region
    spikes_excitatory = spikes_excitatory[spikes_excitatory['region'] ==
                                          region]
    spikes_inhibitory = spikes_inhibitory[spikes_inhibitory['region'] ==
                                          region]

    # Filter for start <= t <= end
    spikes_excitatory = spikes_excitatory[spikes_excitatory['t'] >= start]
    spikes_excitatory = spikes_excitatory[spikes_excitatory['t'] <= stop]

    spikes_inhibitory = spikes_inhibitory[spikes_inhibitory['t'] >= start]
    spikes_inhibitory = spikes_inhibitory[spikes_inhibitory['t'] <= stop]

    # Plot spikes in scatterplot
    fig, ax = plt.subplots(figsize=(10, 4))

    sns.scatterplot(x='t',
                    y='neuron_idx',
                    color='red',
                    s=6,
                    data=spikes_excitatory,
                    ax=ax,
                    label='Pyramidal Cells')
    sns.scatterplot(x='t',
                    y='neuron_idx',
                    color='blue',
                    s=6,
                    data=spikes_inhibitory,
                    ax=ax,
                    label='Interneurons')
    ax.set_ylim(ymin=-20)
    ax.set_ylabel('Neuron index')
    ax.set_xlabel('Time t ($ms$)')
    ax.legend(loc='upper left')

    # ax.set_title('Pyramidal cell (red) and interneuron (blue) spiketrains')

    # Create dummy Line2D objects for legend
    h1 = Line2D([0], [0],
                marker='o',
                markersize=np.sqrt(30),
                color='red',
                linestyle='None')
    h2 = Line2D([0], [0],
                marker='o',
                markersize=np.sqrt(30),
                color='blue',
                linestyle='None')

    ax.legend([h1, h2], ['Pyramidal cells', 'Interneurons'], loc='upper right')

    fig.show()

    ppc_value = mlu.run_analysis_standard_to_df(runnumber)[
        region - 1]['Phaselocke'][l1 - 1, l2 - 1]
    print('ppc_value: ', ppc_value)

    plu.save_figure(fig,
                    filename,
                    runnumbers=[runnumber],
                    l1=l1,
                    l2=l2,
                    region=region,
                    start=start,
                    stop=stop,
                    ppc_value=ppc_value)
import matlab_utils as mlu

runnumber1 = 81
runnumber2 = 103

print_settings = False

if print_settings:
    print(mlu.get_clean_settings(runnumber1))
    print(mlu.get_clean_settings(runnumber2))

print(mlu.compare_settings(runnumber1, runnumber2))
Ejemplo n.º 9
0
def figure_results_coherence_heatmap_with_feedback(runnumbers,
                                                   filename_format,
                                                   show_info_fb_inh=True,
                                                   debug=False):
    """
    :param runnumbers: All runnumbers need to have the same settings except seed!
    :param filename: needs {feedback_conductance_ee} and {feedback_conductance_ei}
    :return:
    """
    sett = mlu.get_clean_settings(runnumbers[0])['sett']
    feedback_conductance_ee = sett['g_syn_ee_r'][0, 1]
    feedback_conductance_ei = sett['g_syn_ei_r'][0, 1]

    # Compute the mean over all runnumbers for standard2 analysis
    analyses_standard2_dfs = [
        mlu.run_analysis_standard2_to_df(runnumber) for runnumber in runnumbers
    ]
    analysis_standard2_mean = pd.concat(analyses_standard2_dfs).groupby(
        level=[0, 1]).mean()

    coherence_mean = analysis_standard2_mean['coh']

    print(
        f"Runs {runnumbers} coherence >= {coherence_threshold}: {sum(coherence_mean >= coherence_threshold)}"
    )

    ## Plotting coherence
    fig, ax = plt.subplots()

    sns.heatmap(coherence_mean.unstack().transpose(),
                cmap='inferno',
                ax=ax,
                vmin=0,
                vmax=1)
    ax.invert_yaxis()

    plu.set_heatmap_axes(ax)

    # ax.set_title(f'Coherence - pyramidal neurons')

    # Insert a textbox listing the feedback conductance
    text = mlu.get_infobox_text(
        feedback_conductance_ee=feedback_conductance_ee,
        feedback_conductance_ei=feedback_conductance_ei,
        debug=debug,
        show_info_fb_inh=show_info_fb_inh)

    plu.set_textbox(ax, text)

    fig.show()

    if filename_format:
        # Convert the float into a string. We are always <1, so cut off everything in front of decimal
        feedback_conductance_ee_str = "{:4.3f}".format(
            feedback_conductance_ee).replace(".", "_")[2:]
        feedback_conductance_ei_str = "{:4.3f}".format(
            feedback_conductance_ei).replace(".", "_")[2:]

        filename = filename_format.format(
            feedback_conductance_ee=feedback_conductance_ee_str,
            feedback_conductance_ei=feedback_conductance_ei_str)

        plu.save_figure(fig,
                        filename,
                        runnumbers=runnumbers,
                        feedback_conductance_ee=feedback_conductance_ee,
                        feedback_conductance_ei=feedback_conductance_ei)
def figure_results_feedforward_conductance_frequency(runnumber, l1,
                                                     filename_format):
    """
    Plots the change in region 2 frequency in dependence on the total synaptic conductance from region 1 to region 2
    :param runnumber:
    :param l1:
    :param filename_format:
    :return:
    """

    sett = mlu.get_clean_settings(runnumber)['sett']
    feedback_conductance_ei = sett['g_syn_ei_r'][0, 1]

    run_settings_loops = mlu.get_run_loops(runnumber)
    analysis_standard_reg1_df, analysis_standard_reg2_df = mlu.run_analysis_standard_to_df(
        runnumber)

    avgmorfreqs1 = analysis_standard_reg1_df['avgmorfreq'][l1]
    avgmorfreqs2 = analysis_standard_reg2_df['avgmorfreq'][l1]

    i_inj_exc = run_settings_loops[1]['values_excitatory'][l1].round(2)
    i_inj_inh = run_settings_loops[1]['values_inhibitory'][l1].round(2)

    synaptic_conductances = run_settings_loops[2]['values'].round(2)

    print(f"Frequency of region 1: {avgmorfreqs1[0]}")
    print(f"Starting frequency of region 2: {avgmorfreqs2[0]}")
    print(f"Ending frequency of region 2: {list(avgmorfreqs2)[-1]}")

    fig, ax = plt.subplots(figsize=(6.4, 4.4))

    sns.scatterplot(x=synaptic_conductances,
                    y=avgmorfreqs1,
                    s=30,
                    ax=ax,
                    label="Region 1")
    sns.scatterplot(x=synaptic_conductances,
                    y=avgmorfreqs2,
                    s=30,
                    ax=ax,
                    label="Region 2")

    ax.set_xlabel(
        r"Total synaptic conductance $g_{1 \to 2}^{e \to e, i}$ ($mS/cm^2$)")
    ax.set_ylim([39, 71])

    ax.set_ylabel('Frequency ($Hz$)')

    # ax.set_title(f"Frequency modulation through synaptic conductance")
    ax.legend(loc='upper left')

    if feedback_conductance_ei != 0:
        text = mlu.get_infobox_text(
            feedback_conductance_ee=None,
            feedback_conductance_ei=feedback_conductance_ei)
        # text = f"$reg_{2}^{{exc}} \\rightarrow reg_{1}^{{inh}}={feedback_conductance_ei} mS/cm^2$"
        plu.set_textbox(ax, text, loc='upper right')

    fig.show()

    if filename_format:
        filename = filename_format.format(runnumber=runnumber, l1=l1)
        plu.save_figure(fig,
                        filename,
                        runnumbers=[runnumber],
                        l1=l1,
                        i_inj_exc=i_inj_exc,
                        i_inj_inh=i_inj_inh,
                        reg1_freq=avgmorfreqs1[0],
                        reg2_freq_start=avgmorfreqs2[0],
                        reg2_freq_end=list(avgmorfreqs2)[-1])
def figure_appendix_analysis_standard_heatmap_with_feedback(
        runnumbers,
        region,
        analysis_standard_name,
        filename_format,
        debug=False):
    """
    :param runnumbers: All runnumbers need to have the same settings except seed!
    :param filename: needs {analysis_standard_name} {feedback_conductance_ee} and {feedback_conductance_ei} and {region}
    :return:
    """

    sett = mlu.get_clean_settings(runnumbers[0])['sett']
    feedback_conductance_ee = sett['g_syn_ee_r'][0, 1]
    feedback_conductance_ei = sett['g_syn_ei_r'][0, 1]

    # Compute the means for standard analyses
    analyses_standard = {}

    group_analyses_standard_reg = [
        mlu.run_analysis_standard_to_df(runnumber)[region]
        for runnumber in runnumbers
    ]
    analyses_standard[region] = pd.concat(group_analyses_standard_reg).groupby(
        level=[0, 1]).mean()

    # # Compute the mean over all runnumbers for standard2 analysis
    # analyses_standard2_dfs = [mlu.run_analysis_standard2_to_df(runnumber) for runnumber in runnumbers]
    # analysis_standard2_mean = pd.concat(analyses_standard2_dfs).groupby(level=[0, 1]).mean()

    if analysis_standard_name in ['Phaselocke', 'Phaselocki']:
        vmin = 0
        vmax = 1
    elif analysis_standard_name in [
            'freqe', 'freqi', 'avgmorfreq', 'avgmorfreqi'
    ]:
        vmin = 35
        vmax = 80
    elif analysis_standard_name in ['re', 'ri']:
        vmin = 10
        vmax = 100
    else:
        vmin = None
        vmax = None

    ## Plotting coherence
    fig, ax = plt.subplots()

    sns.heatmap(analyses_standard[region]
                [analysis_standard_name].unstack().transpose(),
                ax=ax,
                vmin=vmin,
                vmax=vmax,
                cmap='inferno')

    ax.invert_yaxis()
    plu.set_heatmap_axes(ax)
    analysis_title = mlu.analysis_standard_names[
        analysis_standard_name] if not mlu.analysis_standard_names[
            analysis_standard_name] == "" else analysis_standard_name
    ax.set_title(f'{analysis_title} of region {region+1}')

    text = mlu.get_infobox_text(
        feedback_conductance_ei=feedback_conductance_ei,
        feedback_conductance_ee=feedback_conductance_ee,
        runnumbers=runnumbers,
        debug=debug,
        show_info_fb_inh=True)

    plu.set_textbox(ax, text)

    fig.show()

    if filename_format:
        # Convert the float into a string. We are always <1, so cut off everything in front of decimal
        feedback_conductance_ee_str = "{:4.3f}".format(
            feedback_conductance_ee).replace(".", "_")[2:]
        feedback_conductance_ei_str = "{:4.3f}".format(
            feedback_conductance_ei).replace(".", "_")[2:]

        filename = filename_format.format(
            feedback_conductance_ee=feedback_conductance_ee_str,
            feedback_conductance_ei=feedback_conductance_ei_str,
            region=region,
            analysis_standard_name=analysis_standard_name.lower())

        plu.save_figure(fig,
                        filename,
                        runnumbers=runnumbers,
                        feedback_conductance_ee=feedback_conductance_ee,
                        feedback_conductance_ei=feedback_conductance_ei)
def figure_results_correlation_heatmap(runnumbers,
                                       analysis_info2_name,
                                       coherence_threshold,
                                       filename_format,
                                       debug=False,
                                       show_info_fb_inh=True):
    analysis_info2_title = mlu.derive_analysis_info2_title(analysis_info2_name)

    sett = mlu.get_clean_settings(runnumbers[0])['sett']
    feedback_conductance_ee = sett['g_syn_ee_r'][0, 1]
    feedback_conductance_ei = sett['g_syn_ei_r'][0, 1]
    noise_title = mlu.get_noise_title(sett['noiseamp'], sett['noisetype'])

    analysis_standard2_df = mlu.run_analysis_standard2_to_df(runnumbers[0])
    coherences_all = [
        mlu.run_analysis_standard2_to_df(runnumber) for runnumber in runnumbers
    ]
    coherences = pd.concat(coherences_all).groupby(level=[0, 1]).mean()['coh']

    # print(analysis_standard2_df[analysis_standard2_df['coh'] >= coherence_threshold])

    correlations_all = [
        mlu.get_max_correlations(runnumber) for runnumber in runnumbers
    ]
    correlations = pd.concat(correlations_all).groupby(level=[0, 1]).mean()
    correlations = correlations[analysis_info2_name]

    correlations[coherences < coherence_threshold] = np.nan

    print(
        f"{analysis_info2_name}, feedback {feedback_conductance_ei} mS/cm^2. Correlation limits (min, max): ({correlations.min()},{correlations.max()})"
    )

    fig, ax = plt.subplots()

    sns.heatmap(correlations.unstack().transpose(),
                cmap='coolwarm',
                vmin=-0.3,
                vmax=1,
                center=0,
                ax=ax)
    ax.invert_yaxis()

    plu.set_heatmap_axes(ax)

    # Insert a textbox listing the feedback conductance
    text = mlu.get_infobox_text(
        feedback_conductance_ee=feedback_conductance_ee,
        feedback_conductance_ei=feedback_conductance_ei,
        runnumbers=runnumbers,
        debug=debug,
        show_info_fb_inh=True)

    plu.set_textbox(ax, text, loc='lower right')

    # ax.set_title(f"{analysis_info2_title}")

    ax.legend(loc='lower right')

    fig.show()

    if filename_format:
        # Convert the float into a string. We are always <1, so cut off everything in front of decimal
        feedback_conductance_ee_str = "{:4.3f}".format(
            feedback_conductance_ee).replace(".", "_")[2:]
        feedback_conductance_ei_str = "{:4.3f}".format(
            feedback_conductance_ei).replace(".", "_")[2:]
        coherence_threshold_str = "{:3.2f}".format(
            coherence_threshold).replace('.', "")

        filename = filename_format.format(
            analysis_info2_name=analysis_info2_name,
            feedback_conductance_ee=feedback_conductance_ee_str,
            feedback_conductance_ei=feedback_conductance_ei_str,
            coherence_threshold=coherence_threshold_str)

        plu.save_figure(fig,
                        filename,
                        runnumbers=runnumbers,
                        feedback_conductance_ee=feedback_conductance_ee,
                        feedback_conductance_ei=feedback_conductance_ei,
                        analysis_info2_name=analysis_info2_name,
                        coherence_threshold=coherence_threshold)