From 1a67f8ca5cf0da68584740f1a8241f36df4b39af Mon Sep 17 00:00:00 2001 From: Vincent Skywalker Date: Sat, 21 Dec 2024 22:12:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=9B=BE=E7=89=87=E5=AE=BD?= =?UTF-8?q?=E5=BA=A6=E3=80=81=E7=AD=9B=E9=80=89=E5=A4=A7=E4=BA=8E200?= =?UTF-8?q?=E7=9A=84=E6=B6=88=E8=B4=B9=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index ba639e9..9b68c92 100644 --- a/main.py +++ b/main.py @@ -57,7 +57,7 @@ def decrypt_aes_ecb(encrypted_data: str) -> str: all_data[item["mername"]] = item["txamt"] except Exception as e: pass - all_data = {k: round(v / 100, 2) for k, v in all_data.items()} # 将分转换为元,并保留两位小数 + all_data = {k: round(v / 100, 2) for k, v in all_data.items() if round(v / 100, 2) > 200} # 将分转换为元,并保留两位小数 print(len(all_data)) # 输出结果 all_data = dict(sorted(all_data.items(), key=lambda x: x[1], reverse=False)) @@ -68,7 +68,7 @@ def decrypt_aes_ecb(encrypted_data: str) -> str: else: plt.rcParams['font.sans-serif'] = ['SimHei'] - plt.figure(figsize=(12, len(all_data) / 66 * 18)) + plt.figure(figsize=(5, len(all_data) / 66 * 18)) plt.barh(list(all_data.keys()), list(all_data.values())) for index, value in enumerate(list(all_data.values())): plt.text(value + 0.01 * max(all_data.values()), @@ -80,5 +80,6 @@ def decrypt_aes_ecb(encrypted_data: str) -> str: plt.xlim(0, 1.2 * max(all_data.values())) plt.title("华清大学食堂消费情况") plt.xlabel("消费金额(元)") - plt.savefig("result.png") - plt.show() + plt.tight_layout() + plt.savefig("result.png", dpi=600) + plt.show() \ No newline at end of file