美文网首页python学习笔记
学习笔记----python绘图pie

学习笔记----python绘图pie

作者: 三叠纪的小黑猫 | 来源:发表于2020-06-20 19:08 被阅读0次

# python 绘制饼状图


#-*- coding:utf-8 –*-

import matplotlib.pyplot as plt

labels = 'Automated Interpretation', 'Seismic Processing', 'Imaging and Inversion', 'Reservoir Properties'

sizes = [48.2, 20, 13.6, 18.2]

explode = (0.1, 0, 0, 0)  # only "explode" the 2nd slice (i.e. 'Hogs')

fig1, ax1 = plt.subplots()

ax1.pie(sizes, explode=explode, labels=labels, autopct='%1.1f%%', shadow=True, startangle=90)

ax1.axis('equal') 

plt.show()


相关文章

网友评论

    本文标题:学习笔记----python绘图pie

    本文链接:https://www.haomeiwen.com/subject/rdugxktx.html