标签:
import matplotlib.pyplot as plt slices = [7,2,2,13] activities = [‘sleeping‘,‘eating‘,‘working‘,‘playing‘] colors = [‘c‘,‘m‘,‘r‘,‘g‘] plt.pie( slices, labels=activities, colors=colors, startangle=90, shadow=True, explode=(0,0.1,0,0), autopct=‘%1.1f%%‘) plt.title(‘pie chart\n‘) plt.show()
如下图:
标签:
原文地址:http://www.cnblogs.com/flagub/p/4937905.html