import matplotlib.pyplot as plt
import matplotlib
x = [30,40,10,20]
label = ["dfp","d","vrfe","dfv"]
plt.pie(x,labels=label)
plt.show()
添加数字到面积上
import matplotlib.pyplot as plt
import matplotlib
x = [30,40,10,20]
label = ["dfp","d","vrfe","dfv"]
plt.pie(x,labels=label,autopct="%.0f%%")
plt.show()
分离模块
import matplotlib.pyplot as plt
import matplotlib
x = [30,40,10,20]
label = ["dfp","d","vrfe","dfv"]
explods = [0,0.1,0,0]
plt.pie(x,labels=label,autopct="%.0f%%",explode=explods)
plt.show()