Adds automatic output saving

This commit is contained in:
Daniel Svitan
2024-12-23 18:08:18 +01:00
parent 29ab473c3c
commit 6831e847ff
4 changed files with 28 additions and 12 deletions

View File

@@ -40,7 +40,7 @@ def plot_pie(data, labels, title, explode=None):
plt.tight_layout()
if save:
plt.savefig(f"Figure_{graph_index}.png")
plt.savefig(f"results/Figure_{graph_index}.png")
graph_index += 1
else:
plt.show()
@@ -59,7 +59,7 @@ def plot_hist(data, title, xlabel, ylabel):
plt.tight_layout()
if save:
plt.savefig(f"Figure_{graph_index}.png")
plt.savefig(f"results/Figure_{graph_index}.png")
graph_index += 1
else:
plt.show()