diff --git a/experiments/compare_model_slices.py b/experiments/compare_model_slices.py index 5eeb40e..8eccea0 100644 --- a/experiments/compare_model_slices.py +++ b/experiments/compare_model_slices.py @@ -152,7 +152,7 @@ def main() -> None: args.output.parent.mkdir(parents=True, exist_ok=True) paths[0].write_text(json.dumps(report, indent=2, allow_nan=False) + "\n") for path in paths[1:]: - figure.savefig(path, dpi=200) + figure.savefig(path, dpi=200, bbox_inches="tight", pad_inches=.15) plt.close(figure) for path in paths: print(path) diff --git a/experiments/plot_model_slices.py b/experiments/plot_model_slices.py index 237098b..369c18f 100644 --- a/experiments/plot_model_slices.py +++ b/experiments/plot_model_slices.py @@ -215,7 +215,9 @@ def main() -> None: figure = render(load_slice(args.directory), reference_outline=args.reference_outline, title=args.title, pixels=args.pixels) output.parent.mkdir(parents=True, exist_ok=True) for path in paths: - figure.savefig(path, dpi=200) + # Equal physical aspect can leave labels outside the nominal canvas; + # include their extents without changing the axes or field display. + figure.savefig(path, dpi=200, bbox_inches="tight", pad_inches=.15) print(path) plt.close(figure)