python学习笔记

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

2020-06-20  本文已影响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()


上一篇下一篇

猜你喜欢

热点阅读