figure_2.py 文件源码

python
阅读 38 收藏 0 点赞 0 评论 0

项目:Waskom_PNAS_2017 作者: WagnerLabPapers 项目源码 文件源码
def plot_cluster_error(ax):

    res_ftemp = "spatial_analysis/{}_{}_ifs.pkz"
    for exp in ["dots", "sticks"]:

        subjects = get_subject_order(exp)
        color = get_colormap(exp, as_cmap=False)[20]

        errs = []
        for subj in subjects:

            res = moss.load_pkl(res_ftemp.format(subj, exp))
            x = res.steps

            norm = res.null.mean()
            errs.append(res.real / norm)

        errs = np.vstack(errs)
        mean = errs.mean(axis=0)
        ax.plot(x, mean, color=color, lw=2)
        sem = stats.sem(errs, axis=0)
        ax.fill_between(x, mean - sem, mean + sem, alpha=.2, color=color)


    ax.axhline(y=1, lw=1, dashes=[5, 2],
               color=".5", zorder=0,
               xmin=.02, xmax=.98)

    ax.set(xlim=(0, 42),
           ylim=(.55, 1.45),
           yticks=[.6, .8, 1, 1.2, 1.4],
           xticks=[0, 10, 20, 30, 40],
           xlabel="Neighborhood radius (mm)",
           ylabel="Normalized error")

    sns.despine(ax=ax, trim=True)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号