def plot_mean_locations():
    ### Plot the sampled locations for a few neurons
    _, _, _, _, Ls = result
    Ls_rot = []
    for L in Ls:
        R = compute_optimal_rotation(L, pfs)
        Ls_rot.append(L.dot(R))
    Ls_rot = np.array(Ls_rot)

    Ls_mean = np.mean(Ls_rot, 0)

    fig = create_figure(figsize=(1.4,2.5))
    plt.subplot(211, aspect='equal')

    wheel_cmap = gradient_cmap([colors[0], colors[3], colors[2], colors[1], colors[0]])

    for i,k in enumerate(node_perm):
        color = wheel_cmap((np.pi+pfs_th[k])/(2*np.pi))
        plt.plot(pfs[k,0], pfs[k, 1], 'o',
                 markerfacecolor=color, markeredgecolor=color,
                 markersize=4 + 4 * pf_size[k],
                 alpha=0.7)

    #     plt.gca().add_patch(Circle((0,0), radius=rad, ec='k', fc="none"))
    plt.title("True Place Fields")
    plt.xlim(-45, 45)
    # plt.xlabel("$x$")
    plt.xticks([-40, -20, 0, 20, 40], [])
    plt.ylim(-45, 45)
    # plt.ylabel("$y$")
    plt.yticks([-40, -20, 0, 20, 40], [])

    # Now plot the inferred locations


    plt.subplot(212, aspect='equal')

    for i,k in enumerate(node_perm):
        color = wheel_cmap((2*np.pi)/(np.pi+pfs_th[k]))
        plt.plot(Ls_mean[k,0], Ls_mean[k, 1], 'o',
                 markerfacecolor=color, markeredgecolor=color,
                 markersize=4 + 4 * pf_size[k],
                 alpha=0.7)

    #     plt.gca().add_patch(Circle((0,0), radius=rad, ec='k', fc="none"))
    plt.title("Mean Locations")
    plt.xlim(-30, 30)
    plt.xticks([])
    plt.ylim(-30, 30)
    plt.yticks([])

    plt.tight_layout()
    plt.savefig(os.path.join(results_dir, "hipp_mean_locations.pdf"))
    plt.show()
dataset/ETHPy150Open slinderman/pyhawkes/experiments/hippocampus.py/plot_mean_locations/swapped operands of `/`