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)
评论列表
文章目录