Matplotlib绘图——饼图

import matplotlib.pyplot as plt

plt.rcParams['font.sans-serif'] = ['SimHei']   # 用来正常显示中文标签

def type_pie():    # 此函数用来绘制行业类型分布饼图
    labels = ['物流行业','个体经营','建筑行业','制造行业','批发零售业','生活服务业']
    number = [46,41,36,18,31,27]
    explode = [0,0,0,0,0,0]
    plt.pie(number, explode=explode, labels=labels, autopct='%1.1f%%')
    plt.axis('equal')
    plt.savefig(r'D:\Users\Administrator\Desktop\饼图.png', dpi = 600, bbox_inches='tight')
    plt.show()
type_pie()

Matplotlib绘图——饼图_第1张图片

你可能感兴趣的:(Python学习,学习笔记,python,程序人生,经验分享,其他)