Widen the axes margin and fix the clipped y label of Fig. 8

The BERT study spans less than one decade, so its log axis carried the
wide "6 x 10^-1" tick labels, which pushed the y label off the canvas.
Give that axis plain decimal ticks and widen the axes margin of every
result figure by the same amount, which keeps the axes box identical
across figures at the 4:3 ratio.
This commit is contained in:
KiHoLee
2026-08-26 19:09:49 +09:00
parent 6c8471ece0
commit 8fe5f499b8
4 changed files with 12 additions and 4 deletions
+9 -1
View File
@@ -457,7 +457,7 @@ def make_fig(args):
"xtick.minor.width": 0.8, "ytick.minor.width": 0.8,
"xtick.major.size": 4.5, "ytick.major.size": 4.5})
fig = plt.figure(figsize=(5.2, 3.9))
ax = fig.add_axes([0.155, 0.145, 0.82, 0.82])
ax = fig.add_axes([0.185, 0.145, 0.79, 0.79])
for mkey in LAB:
pts = sorted([(float(r["snr_db"]), float(r["ser"]))
for r in rows if r["method"] == mkey])
@@ -468,6 +468,14 @@ def make_fig(args):
ax.semilogy(xs, ys, label=LAB[mkey], ms=5, lw=1.8, **STY[mkey])
ax.set_xlabel("SNR (dB)")
ax.set_ylabel("SER")
# the SER here spans less than one decade, so the default log labels
# are the wide "6 x 10^-1" form, which pushes the y label off canvas;
# plain decimals keep the axis narrow and the label inside
from matplotlib.ticker import FixedLocator, FixedFormatter, NullFormatter
yt = [0.1, 0.15, 0.2, 0.3, 0.4, 0.6]
ax.yaxis.set_major_locator(FixedLocator(yt))
ax.yaxis.set_major_formatter(FixedFormatter([f"{v:g}" for v in yt]))
ax.yaxis.set_minor_formatter(NullFormatter())
ax.grid(True, which="both", alpha=0.35)
ax.legend(fontsize=9, framealpha=1.0, labelspacing=0.3,
handlelength=1.8, loc="center right", bbox_to_anchor=(0.985, 0.66))