我已经绘制了一个饼图,但是它太混乱了! 我已经附上了脚本生成的示例图像!
我的脚本:
emotions = [neutral_avg,sadness_avg,disgust_avg,anger_avg,surprise_avg,fear_avg,happiness_avg]
labels = ['Neutral','Sadness','Disgust','Anger','Surprise','Fear','Happiness']
plt.pie(emotions,labels = labels,shadow=True, startangle=140,autopct='%1.1f%%')
date_string = time.strftime("%Y-%m-%d")
plt.savefig(date_string+'.png')
答案 0 :(得分:0)
您可以尝试:ax1.axis('equal')
示例:
`fig1, ax1 = plt.subplots()
ax1.pie(sizes, explode=explode, labels=labels, autopct='%1.1f%%',
shadow=True, startangle=90)
ax1.axis('equal')`
答案 1 :(得分:0)
<?xml version="1.0" encoding="utf-8"?><page>
䕶法喇嘛所居此處仲無妻室亦降神附體
</page>
将<?xml version="1.0" encoding="UTF-8"?>
<page>䕶法喇嘛所居此處𡸁仲無妻室亦降神附體</page>
,plt.pie(emotions, labels=labels, labeldistance = 1.3,pctdistance = 1.1,shadow=True, startangle=140, autopct='%1.1f%%')
plt.axis('equal')
修改为所需的内容。