diff --git a/CHANGELOG.md b/CHANGELOG.md index 61df4d82..b88d3412 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/). ### Changed - `interact2D`: replaced SimpleNamespace object with a dataclass for more explicit typing +- `quick1D`, `quick2D`: will try to wrap titles if they get too long. - `quick1D`, `quick2D`: refactored for integration with iterators, animations (these functions are wrappers for the class `Quick1DLegacy`, `Quick2DLegacy`). ### Fixed diff --git a/WrightTools/artists/_helpers.py b/WrightTools/artists/_helpers.py index bf37095a..7f5d237e 100644 --- a/WrightTools/artists/_helpers.py +++ b/WrightTools/artists/_helpers.py @@ -70,11 +70,11 @@ def _title(fig, title, subtitle="", *, margin=1, fontsize=20, subfontsize=18): subfontsize : number (optional) Subtitle fontsize. Default is 18. """ - fig.suptitle(title, fontsize=fontsize) + fig.suptitle(title, fontsize=fontsize, wrap=True) height = fig.get_figheight() # inches distance = margin / 2.0 # distance from top of plot, in inches ratio = 1 - distance / height - return fig.text(0.5, ratio, subtitle, fontsize=subfontsize, ha="center", va="top") + return fig.text(0.5, ratio, subtitle, fontsize=subfontsize, ha="center", va="top", wrap=True) def add_sideplot(