From ebfc342736ff9d891e549bd11b19ca716b0f0aa7 Mon Sep 17 00:00:00 2001 From: Xiaolan Bot Date: Mon, 23 Feb 2026 01:37:58 +0800 Subject: [PATCH] fix(bug): remove local matplotlib import shadowing global plt in stats --- SubMind.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SubMind.py b/SubMind.py index f9b6de7..558ae92 100644 --- a/SubMind.py +++ b/SubMind.py @@ -518,7 +518,7 @@ async def stats(update: Update, context: CallbackContext): try: theme_colors = ['#3B82F6', '#10B981', '#F59E0B', '#EF4444', '#8B5CF6', '#EC4899', '#14B8A6', '#F97316', '#6366F1', '#84CC16'] if len(category_costs) > len(theme_colors): - import matplotlib.pyplot as plt + # 移除导致遮蔽的局部 import,直接使用全局的 matplotlib 和 plt extra_colors = [matplotlib.colors.to_hex(c) for c in plt.get_cmap('tab20').colors] theme_colors.extend(extra_colors)