fix formatting!
This commit is contained in:
parent
834ab86cca
commit
0e5b491493
1 changed files with 5 additions and 1 deletions
|
@ -35,11 +35,15 @@ class QuoteQuota(commands.Cog):
|
|||
:param counts: The number of times the username appears in the chat
|
||||
:returns: The pie chart image
|
||||
"""
|
||||
|
||||
def pct(v: int):
|
||||
return f"{v / sum(counts) * 100:.1f}% ({v})"
|
||||
|
||||
fig, ax = plt.subplots()
|
||||
ax.pie(
|
||||
counts,
|
||||
labels=usernames,
|
||||
autopct='%1.1f%% (%d)',
|
||||
autopct=pct,
|
||||
)
|
||||
fio = io.BytesIO()
|
||||
fig.savefig(fio, format='jpg', bbox_inches='tight')
|
||||
|
|
Loading…
Reference in a new issue