python可視化之扇形圖

 

 

# 導入matplotlib庫
import matplotlib.pyplot as plt
import matplotlib as mp1

# 導入numpy庫
import numpy as np


# 設置輸出文字類型
mp1.rcParams['font.family'] = 'STFangsong'

# 設置標籤
labels =["廣州倉","中山倉","深圳倉","東莞倉"]

# 設置數據
fracs = [66666,55555,88888,99999]

# 畫面積圖
plt.pie(fracs,labels = labels,autopct = '%.0f%%')

# 可視化呈現
plt.show()
相關文章
相關標籤/搜索