From 55fa03fa124a57c3509ac11467c126b04ffb9ef1 Mon Sep 17 00:00:00 2001 From: Michael Grupp Date: Thu, 31 Oct 2024 11:07:43 +0100 Subject: [PATCH] Save figures with tight bbox (#703) Fits the image bbox to the content to avoid unnecessary blank space. Enabled globally to work with `--save_plot` and with the save button of the matplotlib Qt / Tk GUI canvas. Closes #701 --- evo/tools/plot.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/evo/tools/plot.py b/evo/tools/plot.py index 4390bc3..c780175 100644 --- a/evo/tools/plot.py +++ b/evo/tools/plot.py @@ -78,7 +78,8 @@ def apply_settings(settings: SettingsContainer = SETTINGS): # https://matplotlib.org/stable/users/explain/axes/constrainedlayout_guide.html "figure.constrained_layout.use": True, "font.family": settings.plot_fontfamily, - "pgf.texsystem": settings.plot_texsystem + "pgf.texsystem": settings.plot_texsystem, + "savefig.bbox": "tight", }) if "xkcd" in settings: plt.xkcd()