您当前的位置: 首页 >  Python

星拱北辰

暂无认证

  • 0浏览

    0关注

    1205博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

【Python】Matplotlib绘制饼图

星拱北辰 发布时间:2019-11-08 21:41:57 ,浏览量:0

import matplotlib.pyplot as plt

detal = [0.2515, 0.0057, 0.3336, 0.0368, 0.3724]

labels = ['A', 'B', 'C', 'D', 'E']

colors = ['deeppink', 'red', 'lime', 'yellow', 'cyan']

explode = [0.1, 0.2, 0, 0, 0]

plt.xlim(0, 4)

plt.ylim(0, 4)

plt.axis('equal')

plt.pie(x=detal, labels=labels, explode=explode, autopct='%3.1f%%',
        shadow=True, labeldistance=1.1, startangle=90, pctdistance=0.6, colors=colors)

plt.show()

在这里插入图片描述

调色方面,参考了Matplotlib调色,大家可以读一读,调出自己喜欢的颜色。

关注
打赏
1660750074
查看更多评论
立即登录/注册

微信扫码登录

0.0448s