饼图

import matplotlib.pyplot as plt
labels = ['Nokia','apple','sumsug','lumai']
values = [10,30,45,15]
colors = ['yellow','green','red','blue']
explode = [0.3,0,0,0]
plt.title('A Pie Chart')
plt.pie(values,labels=labels,colors=colors,explode=explode,shadow=True,
autopct='%1.f%%',startangle=180)
plt.axis('equal')
plt.show()

原文地址:https://www.cnblogs.com/wei23/p/13121986.html