import matplotlib.pyplot as plt
all = 400 + 200 + 100 + 50 + 100 + 60 + 60
pieLabels = ['milk', 'water', 'vegetable', 'meat', 'fruit', 'eggs', 'others']
baifenbi = [400/all, 200/all, 100/all, 50/all, 100/all, 60/all, 60/all]
plt.pie(baifenbi, labels=pieLabels)
plt.savefig("2.jpg")
使用matplotlib绘制饼图
最新推荐文章于 2023-11-15 08:45:00 发布