import matplotlib
as mpl
import matplotlib
.pyplot
as plt
mpl
.rcParams
["font.sans-serif"] = ["SimHei"]
mpl
.rcParams
["axes.unicode_minus"] = False
labels
= "A难度水平","B难度水平","C难度水平","D难度水平"
students
= [0.35,0.15,0.20,0.30]
colors
= ["#377eb8","#4daf4a","#984ea3","#ff7f00"]
plt
.pie
(students
,
labels
= labels
,
autopct
="%3.1f%%",
startangle
=45,
pctdistance
=0.7,
labeldistance
=1.2,
colors
=colors
)
plt
.title
("选择不同难度测试试卷的学生占比")
plt
.show
()
转载请注明原文地址:https://blackberry.8miu.com/read-6806.html