matplotlib 知识点:绘制饼图 matplotlib.pyplot.pie( )
#!/usr/bin/env python#!-*-coding:utf-8 -*-#!@Author : Biyoulin#!@Time: 2020/10/16 10:45import matplotlib.pyplot as pltplt.rcParams['font.sans-serif']=['SimHei'] #用来正常显示中文标签labels = ['衬衫','羊毛衫','雪纺衫','
·
#!/usr/bin/env python
#!-*-coding:utf-8 -*-
#!@Author : Biyoulin
#!@Time : 2020/10/16 10:45
import matplotlib.pyplot as plt
plt.rcParams['font.sans-serif']=['SimHei'] #用来正常显示中文标签
labels = ['衬衫','羊毛衫','雪纺衫','裤子','高跟鞋','袜子']
sizes = [11,12,13,10,10,10]
explode = (0,0,0,0.1,0,0)
plt.pie(sizes,explode=explode,labels=labels,autopct='%1.1f%%',shadow=False,startangle=150)
plt.title("优衣库")
plt.show()
更多推荐
已为社区贡献1条内容
所有评论(0)