diff --git a/setup.cfg b/setup.cfg index 6fe0e21..6e18c22 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = footsteps -version = 0.1.8 +version = 0.1.9 author = Hastings Greer author_email = footsteps@hgreer.com description = a minimal experiment logging package diff --git a/src/footsteps/__init__.py b/src/footsteps/__init__.py index ad40b25..f9c8375 100644 --- a/src/footsteps/__init__.py +++ b/src/footsteps/__init__.py @@ -135,3 +135,11 @@ def __getattr__(name): initialize() return output_dir_impl raise AttributeError(f"module '{__name__}' has no attribute '{name}'") + +num_plots = 0 +def plot(name=""): + global num_plots + import matplotlib.pyplot as plt + plt.savefig(__getattr__("output_dir") + f"{num_plots:03d}_{name}.png") + plt.clf() + num_plots += 1