matplotlib 饼状图

import matplotlib.pyplot as plt
import matplotlib as mpl

# 支持中文
plt.rcParams['font.sans-serif'] = ['SimHei']  # 用来正常显示中文标签
plt.rcParams['axes.unicode_minus'] = False  # 用来正常显示负号

labels= ["1",'3','2',"4","5"]
data = [4000,50,500,3000,500]
plt.pie(data,labels = labels,autopct="%1.1f%%")
plt.show()

 

 

 

 

posted @ 2020-03-15 20:13  brady-wang  阅读(177)  评论(0编辑  收藏  举报