mfista_ft.py 文件源码

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

项目:sparselab 作者: eht-jp 项目源码 文件源码
def mfista_plots(fdfin, ptable, filename=None,
                 plotargs={'ms': 1., }):
    isinteractive = plt.isinteractive()
    backend = matplotlib.rcParams["backend"]

    if isinteractive:
        plt.ioff()
        matplotlib.use('Agg')

    nullfmt = NullFormatter()

    # Get model data
    modelptable = ptable.copy()
    modelptable.observe(fdfin)

    # Save fdf
    if filename is not None:
        util.matplotlibrc(nrows=4, ncols=2, width=400, height=150)
    else:
        matplotlib.rcdefaults()

    fig, axs = plt.subplots(nrows=4, ncols=2, sharex=False)
    fdfin.plot(axs=axs[:,0],color="red")
    ptable.plot(axs=axs[:,1],color="black", ploterror=True)
    modelptable.plot(axs=axs[:,1], color="red")
    if filename is not None:
        plt.savefig(filename)
        plt.close()
    else:
        plt.show()

    if isinteractive:
        plt.ion()
        matplotlib.use(backend)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号