From 8fe5f499b8ccc4fad5c1e5b15778368da9aef8a6 Mon Sep 17 00:00:00 2001 From: KiHoLee Date: Wed, 26 Aug 2026 19:09:49 +0900 Subject: [PATCH] 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. --- c13_mnist.py | 2 +- c18_mnist_doppler.py | 2 +- c19_mnist_epoch.py | 2 +- c20_bert.py | 10 +++++++++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/c13_mnist.py b/c13_mnist.py index 2eb8914..0cba2e9 100755 --- a/c13_mnist.py +++ b/c13_mnist.py @@ -518,7 +518,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]) diff --git a/c18_mnist_doppler.py b/c18_mnist_doppler.py index d080ad2..a7e9e7c 100755 --- a/c18_mnist_doppler.py +++ b/c18_mnist_doppler.py @@ -130,7 +130,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["fd_norm"]), float(r["ser"])) for r in rows if r["method"] == mkey]) diff --git a/c19_mnist_epoch.py b/c19_mnist_epoch.py index 81b3bd2..f3517d6 100755 --- a/c19_mnist_epoch.py +++ b/c19_mnist_epoch.py @@ -209,7 +209,7 @@ def main(): "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]) xgrid = sorted({int(r["step"]) for r in rows if r["method"] == "semantic"}) if "digital_genie" in floors: diff --git a/c20_bert.py b/c20_bert.py index c7b33a2..34d4037 100755 --- a/c20_bert.py +++ b/c20_bert.py @@ -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))