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

    # Bin the data
    from pyhawkes.utils.utils import convert_continuous_to_discrete
    S_dt = convert_continuous_to_discrete(S, C, 0.25, 0, T)

    # Smooth the data to get a firing rate
    from scipy.ndimage.filters import gaussian_filter1d
    S_smooth = np.array([gaussian_filter1d(s, 4) for s in S_dt.T]).T

    # Run pca to gte an embedding
    from sklearn.decomposition import PCA
    pca = PCA(n_components=2)
    pca.fit(S_smooth)
    Z = pca.components_.T

    # Rotate
    R = compute_optimal_rotation(Z, pfs, scale=False)
    Z = Z.dot(R)

    wheel_cmap = gradient_cmap([colors[0], colors[3], colors[2], colors[1], colors[0]])
    fig = create_figure(figsize=(1.4,2.9))
    # plt.subplot(211, aspect='equal')
    ax = create_axis_at_location(fig, .3, 1.7, 1, 1)


    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(-3, 3)
    plt.xticks([-2, 0, 2])
    plt.ylim(-3, 3)
    plt.yticks([-2, 0, 2])


    # plt.subplot(212, aspect='equal')
    ax = create_axis_at_location(fig, .3, .2, 1, 1)

    for i,k in enumerate(node_perm):
        color = wheel_cmap((np.pi+pfs_th[k])/(2*np.pi))
        plt.plot(Z[k,0], Z[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("PCA Locations")
    plt.xlim(-.5, .5)
    # plt.xlabel("$x$")
    plt.xticks([-.4, 0, .4])
    plt.ylim(-.5, .5)
    # plt.ylabel("$y$")
    plt.yticks([-.4, 0, .4])

    # plt.tight_layout()
    plt.savefig(os.path.join(results_dir, "hipp_mean_pca_locations.pdf"))
    plt.show()


# plot_pred_lls(results)
dataset/ETHPy150Open slinderman/pyhawkes/experiments/hippocampus.py/plot_mean_and_pca_locations/swapped operands of `/`