コード例 #1
0
    ax = fig.gca(projection='3d')
    plt.title("Tuning Curve Width v %s, %s" % (var_pair[0], var_pair[1]))
    ax.set_xlabel(var_pair[0])
    ax.set_ylabel(var_pair[1])
    ax.set_zlabel('tuning curve width')

    # Plot separate tuning curve data for pyramidal and inhibitory neurons
    for n in z_vals_all[0].keys():
        if n == 'pyr':
            c = 'blue'
            plt_sty = 'b-'
        else:
            c = 'red'
            plt_sty = 'r-'
        z_vals = [dic[n] for dic in z_vals_all]
        ax.plot_trisurf(x_vals, y_vals, z_vals, color=c)

    # Reset variable to default value and increment
    args[var_pair[0]] = args_defaults[0]
    args[var_pair[1]] = args_defaults[1]
    rt.inc_var(var_pair)

    # Save the figure
    if save_graphs:
        plt.savefig('figures/%s_%s %s.png' \
                 % (var_pair[0], var_pair[1], strftime("%Y-%m-%d %H:%M")))

# Display results of all simulations
rt.final(send_msg)
if show_graphs:
    plt.show()
コード例 #2
0
    tun_curve_w = [{} for i in test_range]
    tun_curve_sem = [{} for i in test_range]
    for i in range(len(firing_rates)):
        for n in firing_rates[i].keys():
            tuning_widths = [len(j) - j.count(0.0) for j in firing_rates[i][n]]
            tun_curve_w[i][n] = np.mean(tuning_widths)
            neuron_num = args['freq_num'] * args[n + '_layer_num']
            tun_curve_sem[i][n] = stats.sem(tuning_widths)

    ###########################################
    ####   GRAPHS   ###########################
    ###########################################

    # Basic plot setup
    plt.figure(len(rt.completed_vars) + 1)
    rt.inc_var(variable)
    plt.title("Tuning Curve Width v %s" % variable)
    plt.xlabel(variable)
    plt.ylabel('tuning curve width')

    # Plot separate tuning curve data for pyramidal and inhibitory neurons
    for n in firing_rates[0].keys():
        if n == 'pyr':
            plt_sty = 'b-'
        else:
            plt_sty = 'r-'
        y_axis = [dic[n] for dic in tun_curve_w]
        plt.plot(test_range, y_axis, plt_sty)
        plt.errorbar(test_range,
                     y_axis,
                     yerr=[dic[n] for dic in tun_curve_sem],