📜  matplotlib 饼图顺序 - 任何代码示例

📅  最后修改于: 2022-03-11 15:00:03.744000             🧑  作者: Mango

代码示例1
colors = [ '#99f3bd', '#fbaccc','#a8df65', '#ff7b54']
fig, ax = plt.subplots(figsize=(5,15))
ax.set_title('Treatment Group', fontsize=25, fontname="Times New Roman Bold")
ax = df['q6_t'].value_counts(normalize=True).plot.pie(autopct='%1.0f%%', colors = colors)
ax.set_ylabel("")
plt.savefig('q6_t.png', bbox_inches = 'tight', transparent=True)