50LABEL_PT, TICK_PT, LEGEND_PT = 22, 20, 15
123 for nb
in manifest_mod.M2R_BINS:
124 rec = B.get(f
"M2R_B{nb}")
127 rows.append((rec.get(
"N_eq", np.nan), nb, v))
129 print(
" no completed M2 rungs; nothing to draw")
133 panels = [o
for o
in OBS
if o[0]
in CONV_KEYS]
134 fig, axes = plt.subplots(2, 2, figsize=(15, 11))
135 x = [r[0]
for r
in rows]
136 for ax, (key, name, unit)
in zip(axes.ravel(), panels):
137 y = [r[2][key]
for r
in rows]
138 series = list(y) + ([ref[key]]
if ref
is not None else [])
140 ax.plot(x, [v / div
for v
in y],
"o-", color=
"steelblue", ms=10,
141 label=
"bin-moment rungs")
143 ax.axhline(ref[key] / div, color=
"tomato", ls=
"--", lw=3,
144 label=f
"exact ({rid})")
149 ax.text(0.5, 0.06,
"no exact arm — self-convergence only",
150 transform=ax.transAxes, ha=
"center", color=
"tomato",
155 ax.xaxis.set_major_locator(mticker.MaxNLocator(nbins=5, integer=
True))
156 ax.yaxis.set_major_locator(mticker.MaxNLocator(nbins=6))
157 ax.set_xlabel(
r"$N_{\rm eq}$")
158 ax.set_ylabel(f
"{name} ({pref}{unit})")
159 ax.grid(
True, which=
"major", alpha=0.25)
160 axes.ravel()[0].legend(loc=
"best", frameon=
True, framealpha=0.92)
162 OUT.mkdir(parents=
True, exist_ok=
True)
163 p = OUT /
"M_convergence.pdf"
164 fig.savefig(p, bbox_inches=
"tight")
170 """The 2-D sweep: deviation against i_discrete, one curve per I_bin.
172 This is the figure the M2R ladder could not draw. M2R swept I_bin at fixed
173 i_discrete and found d_111 flat at -5 to -7%; the convergence axis for that
174 observable is i_discrete, so the ladder was moving along a contour of the
175 error surface rather than down it. Plotted this way the curves collapse:
176 the spread BETWEEN I_bin values at one i_discrete is small, while the fall
177 ALONG i_discrete is the whole effect.
181 print(
" no exact arm; skipping the 2-D figure")
183 fig, axes = plt.subplots(3, 2, figsize=(15, 15))
184 cmap = plt.get_cmap(
"viridis")
186 for ax, (key, name, _unit)
in zip(axes.ravel(), OBS):
187 for c, nb
in enumerate(manifest_mod.M2D_BINS):
189 for i_d
in manifest_mod.M2D_IDISC:
190 v =
scored(B.get(f
"M2D_I{i_d}_B{nb}"))
191 if v
is None or not ref[key]:
194 ys.append((v[key] - ref[key]) / ref[key] * 100.0)
197 ax.plot(xs, ys,
"o-", ms=9,
198 color=cmap(c / max(1, len(manifest_mod.M2D_BINS) - 1)),
199 label=f
"$I_{{\\rm bin}}$ = {nb}")
200 ax.axhline(0.0, color=
"tomato", ls=
"--", lw=3)
202 ax.set_xlabel(
r"$i_{\rm discrete}$")
203 ax.set_ylabel(f
"{name} dev (%)")
204 ax.grid(
True, which=
"both", alpha=0.25)
207 print(
" no completed 2-D cells yet")
209 axes.ravel()[0].legend(loc=
"best", frameon=
True, framealpha=0.92)
211 OUT.mkdir(parents=
True, exist_ok=
True)
212 p = OUT /
"M_2d_sweep.pdf"
213 fig.savefig(p, bbox_inches=
"tight")