import matplotlib.pyplot as plt
sleeping = [7,8,6,7,11]
eating = [2,2,3,4,2]
working = [7,8,7,9,10]
playing = [8,5,7,6,12]
slices = [6,4,2,13]
activitices = ['sleeping','eating','working','playing']
cols = ['c','m','r','b']
plt.pie(slices ,
labels= activitices ,
colors=cols,
startangle=90,
shadow= True,
explode=[0,0.1,0,0],
autopct= '%1.1f%%')
#plt.xlabel('x')
#plt.ylabel('y')
plt.title('Interesting Graph\nCheck it out')
#plt.legend()
plt.show()
Matplotlib Tutorial 6 pie Charts
最新推荐文章于 2024-07-31 14:30:10 发布