fix formatting!

This commit is contained in:
Nexus 2024-03-19 00:14:50 +00:00
parent 834ab86cca
commit 0e5b491493
Signed by: nex
GPG key ID: 0FA334385D0B689F

View file

@ -35,11 +35,15 @@ class QuoteQuota(commands.Cog):
:param counts: The number of times the username appears in the chat :param counts: The number of times the username appears in the chat
:returns: The pie chart image :returns: The pie chart image
""" """
def pct(v: int):
return f"{v / sum(counts) * 100:.1f}% ({v})"
fig, ax = plt.subplots() fig, ax = plt.subplots()
ax.pie( ax.pie(
counts, counts,
labels=usernames, labels=usernames,
autopct='%1.1f%% (%d)', autopct=pct,
) )
fio = io.BytesIO() fio = io.BytesIO()
fig.savefig(fio, format='jpg', bbox_inches='tight') fig.savefig(fio, format='jpg', bbox_inches='tight')