Clear plot when used

This commit is contained in:
Nexus 2024-04-16 13:14:31 +01:00
parent f316351d16
commit 25f5453e1c
Signed by: nex
GPG key ID: 0FA334385D0B689F

View file

@ -67,6 +67,7 @@ class QuoteQuota(commands.Cog):
usernames = list(new_mapping.keys()) usernames = list(new_mapping.keys())
counts = list(new_mapping.values()) counts = list(new_mapping.values())
plt.clf()
fig, ax = plt.subplots(figsize=(7, 7)) fig, ax = plt.subplots(figsize=(7, 7))
ax.pie( ax.pie(
counts, counts,
@ -264,6 +265,7 @@ class QuoteQuota(commands.Cog):
:return: A discord.File with the rendered graph :return: A discord.File with the rendered graph
""" """
hrs = [x.zfill(2) for x in hours.keys()] hrs = [x.zfill(2) for x in hours.keys()]
plt.clf()
plt.title("Truth times") plt.title("Truth times")
plt.xlabel("Hour") plt.xlabel("Hour")
plt.ylabel("Truths") plt.ylabel("Truths")