import matplotlib.pyplot as plt
# 多圖並排
fig, axes = plt.subplots(1, 3, figsize=(15, 4))
axes[0].plot(dates, values, marker='o', color='#6366f1')
axes[0].set_title('每月銷售趨勢')
axes[1].bar(categories, amounts, color=['#4ade80','#f472b6','#fbbf24'])
axes[1].set_title('產品類別銷售')
axes[2].pie(sizes, labels=labels, autopct='%1.1f%%')
axes[2].set_title('市場佔有率')
plt.tight_layout()
plt.savefig('report.png', dpi=150, bbox_inches='tight')
🎨 中文字型:Windows 用 'Microsoft JhengHei',Mac 用 'PingFang TC'
📐 subplots 多圖並排比單獨畫圖更專業,適合做報告。