先看效果:
代码:
# -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
labels ='A','B','C','D'
fraces = [15, 30, 45, 10]
plt.pie(x=fraces, labels=labels,autopct='%0f%%', shadow=True)
plt.savefig("test.png")
plt.show()
参考:https://blog.youkuaiyun.com/qq_31390999/article/details/82828898
本文介绍了一种使用Python的matplotlib库来绘制带有阴影效果的饼状图的方法,展示了如何设置标签、比例和百分比显示,最后保存图表为图片并展示。
1953

被折叠的 条评论
为什么被折叠?



