sup_figure_3.py 文件源码

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

项目:Waskom_PNAS_2017 作者: WagnerLabPapers 项目源码 文件源码
def plot_prediction_curves(subjects, axes, exp):

    res_ftemp = "spatial_analysis/{}_{}_ifs.pkz"
    for subj, ax in zip(subjects, axes):

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

        norm = res.null.mean()
        real = res.real / norm
        pint = res.pint / norm

        ax.plot(x, real, "o-", color=".15",
                ms=2.5, clip_on=False)
        ax.fill_between(x, *pint, color=".4", alpha=.3)

        cross_x, cross_y = res.intersect
        cross_y /= norm

        ax.plot([cross_x, cross_x], [0, cross_y],
                lw=.8, dashes=[3, 1], color=".5", zorder=0)

        ax.set(xlim=(0, 40), ylim=(0, 2),
               xticks=np.linspace(0, 40, 5),
               yticks=[0, 1, 2],
               yticklabels=[0, 1, 2])

        sns.despine(ax=ax)

    ylabel = "Normalized error"
    plt.setp(axes[1:7], yticklabels=[])
    axes[0].set(ylabel=ylabel)

    if exp == "dots":
        plt.setp(axes[8:], yticklabels=[])
        plt.setp(axes[:7], xticklabels=[])
        axes[7].set_ylabel(ylabel)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号