Preserve slice titles and colorbar labels in saved figure bounds
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user