import matplotlib.pyplot as plt
x = [2, 34, 36, 14, 14]
labels = ["dad","ada","ddd","aaa","s"]
colors = ["red", "yellow", 'blue', 'black','green']
#创建画布,figsize为窗口大小,dpi为图片大小
plt.figure(figsize=(10, 10), dpi=50)
#图像绘制x:数量,自动算百分比 labels:每部分名称colors:每部分颜色
plt.pie(x, labels=labels,colors=colors)
#显示图像
plt.show()
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)