def plotTimeVsLvls(ax, runs, *args, **kwargs):
"""Plots Time vs TOL of @runs, as
returned by MIMCDatabase.readRunData()
ax is in instance of matplotlib.axes
"""
ax.set_xlabel(r'$\ell$')
ax.set_ylabel('Time (s)')
ax.set_yscale('log')
fnNorm = kwargs.pop("fnNorm")
if "__calc_moments" in kwargs:
_, _, Tl, M, _ = kwargs.pop("__calc_moments")
else:
_, _, Tl, M, _ = __calc_moments(runs,
seed=kwargs.pop('seed', None),
direction=kwargs.pop('direction', None), fnNorm=fnNorm)
ax.xaxis.set_major_locator(MaxNLocator(integer=True))
min_tl = np.nanpercentile(Tl, 5, axis=1)
med = np.nanmean(Tl, axis=1)
max_tl = np.nanpercentile(Tl, 95, axis=1)
line = ax.errorbar(np.arange(0, len(Tl)),
med, yerr=[med-min_tl, max_tl-med],
*args, **kwargs)
return line[0].get_xydata(), [line]
评论列表
文章目录