From 862bb161ec435dc0e4fe4025b7f4296c1e8b4153 Mon Sep 17 00:00:00 2001 From: Dean Poulos Date: Wed, 28 Aug 2024 20:12:24 +1000 Subject: [PATCH] Hotfix/fix figure saving in datahandler (#230) * Add bbox_inches='tight' so text isn't cut off. * Document changes. --- CHANGELOG.md | 3 +++ qualang_tools/results/data_handler/data_processors.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c3c03c1..d35dcf86 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) ### Added - results - Allow the data saver to create the root folder if it doesn't exist. +### Fixed +- data_handler - Fix figure saving cutting off title text if it is long using `bbox_inches="tight"`. + ## [0.17.7] - 2024-08-20 ### Added - VoltageGateSequence - The `VoltageGateSequence` class facilitates the creation and management of complex pulse sequences, allowing dynamic voltage control, ramping, and bias compensation across gate elements. diff --git a/qualang_tools/results/data_handler/data_processors.py b/qualang_tools/results/data_handler/data_processors.py index 5a991e0e..82750458 100644 --- a/qualang_tools/results/data_handler/data_processors.py +++ b/qualang_tools/results/data_handler/data_processors.py @@ -106,7 +106,7 @@ def process(self, data): def post_process(self, data_folder: Path): for path, fig in self.data_figures.items(): - fig.savefig(data_folder / path) + fig.savefig(data_folder / path, bbox_inches="tight") DEFAULT_DATA_PROCESSORS.append(MatplotlibPlotSaver)