Skip to content

Instantly share code, notes, and snippets.

@ArthurDelannoyazerty
Last active March 27, 2024 10:28
Show Gist options
  • Save ArthurDelannoyazerty/b35f366d8168b96cc1a17bad6c0eb0c4 to your computer and use it in GitHub Desktop.
Save ArthurDelannoyazerty/b35f366d8168b96cc1a17bad6c0eb0c4 to your computer and use it in GitHub Desktop.
To put in a script. Can save and/or show a plot. Save the plot in a big window.
import matplotlib.pyplot as plt
SHOW = False
SAVE = True
def display_save_plt(title:str):
if SAVE:
plt.gcf().set_size_inches(25, 13)
plt.savefig("data/stats/" + title + ".png", dpi=200)
if SHOW:
plt.gcf().set_size_inches(20, 11)
plt.show()
if not SHOW:plt.clf()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment