def pieGraphics(Labels,ValueList,graphicTitle='??'):
colors = ['yellowgreen', 'gold', 'lightskyblue', 'lightcoral', "blue","green","cyan","magenta"]
maxdata = max(ValueList)
explode = []
for v in ValueList:
if v == maxdata:
explode.append(0.1)
else:
explode.append(0)
print(explode)
patches,l_text,p_text = plt.pie(ValueList, labels=Labels, colors=colors,autopct='%1.1f%%',explode=explode ,shadow=True, startangle=90)
for font in l_text:
font.set_fontproperties(FontProperties(fname=PATH_SUFFIX+'SIMLI.TTF'))
plt.title(graphicTitle,fontproperties=font_set,y=1.05)
# Set aspect ratio to be equal so that pie is drawn as a circle.
plt.axis('equal')
plt.show()
评论列表
文章目录