From ec86900d0edf54785997850e2a53a74c7da3d5f2 Mon Sep 17 00:00:00 2001 From: Valentin Boettcher Date: Wed, 29 Jan 2025 16:05:36 -0500 Subject: [PATCH] use function name as default title --- hiroplotutils/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hiroplotutils/__init__.py b/hiroplotutils/__init__.py index 1b51ff4..4eee61e 100644 --- a/hiroplotutils/__init__.py +++ b/hiroplotutils/__init__.py @@ -26,7 +26,8 @@ def noop_if_interactive(f): return wrapped -def make_figure(fig_name: str = "interactive", *args, **kwargs): +def make_figure(fig_name: str | None = None, *args, **kwargs): + fig_name = fig_name or inspect.stack()[1].function fig = plt.figure(fig_name, *args, **kwargs) fig.clf() return fig