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()
原文地址:https://www.cnblogs.com/php-linux/p/12499692.html
时间: 2024-11-29 12:10:14