1. Home
  2. Docs
  3. Python
  4. Pandas
  5. 繪圖-中文

繪圖-中文


import matplotlib.pyplot as plt

plt.rcParams['font.sans-serif'] = ['Microsoft JhengHei']
plt.rcParams['axes.unicode_minus'] = False  # 步驟二(解決座標軸負數的負號顯示問題)

df2.plot(x='年別', y='全年銷售千額', grid=True, color='blue')
# plt.show()

df2.plot.bar(x='年別', y='全年銷售千額', grid=True, stacked=True)  # 上下
# plt.show()