python 绘制多重饼图

import numpy as np
import matplotlib.pyplot as plt
import pylab as pl
from pyecharts.charts import Pie
#画出2行3列的饼图
#显示中文
plt.rcParams['font.sans-serif'] = ['Arial Unicode MS']


labels = ['E','T','W','M','I']
# 231 > 2行3列第1个
fig1 = pl.subplot(251)
pl.pie([692,346,528,169,4],labels=labels,shadow=False,startangle=90)
plt.axis('equal')
plt.title("中国")


# 232 > 2行3列第2个
fig2 = pl.subplot(252)
pl.pie([530,538,20,48,25],labels=labels,shadow=False,startangle=90)
plt.axis('equal')
plt.title("印度")

# 233 > 2行3列第3个
fig3 = pl.subplot(253)
pl.pie([194,42,28,7,173],labels=labels,shadow=False,startangle=90)
plt.axis('equal')
plt.title("俄罗斯")


# 234 > 2行3列第4个
fig4 = pl.subplot(254)
pl.pie([207,41,2,6,3],labels=labels,shadow=False,startangle=90)
plt.axis('equal')
plt.title("土耳其")


fig5 = pl.subplot(255)
pl.pie([149,21,23,6,5],labels=labels,shadow=False,startangle=90)#startangle表示饼图的起始角度
plt.axis('equal') #这行代码加入饼图不会画成椭圆
plt.title("泰国")

fig6 = pl.subplot(256)
pl.pie([143,32,14,4,3],labels=labels,shadow=False,startangle=90)#startangle表示饼图的起始角度
plt.axis('equal') #这行代码加入饼图不会画成椭圆
plt.title("菲律宾")

fig7 = pl.subplot(257)
pl.pie([86,37,27,2,14],labels=labels,shadow=False,startangle=90)#startangle表示饼图的起始角度
plt.axis('equal') #这行代码加入饼图不会画成椭圆
plt.title("印度尼西亚")

fig8 = pl.subplot(258)
pl.pie([66,57,24,5,6],labels=labels,shadow=False,startangle=90)#startangle表示饼图的起始角度
plt.axis('equal') #这行代码加入饼图不会画成椭圆
plt.title("马来西亚")

fig9 = pl.subplot(259)
pl.pie([94,13,7,3,3],labels=labels,shadow=False,startangle=90)#startangle表示饼图的起始角度
plt.axis('equal') #这行代码加入饼图不会画成椭圆
plt.title("越南")

fig10 = pl.subplot(2,5,10)
pl.pie([105,2,3,1,5],labels=labels,shadow=False,startangle=90)#startangle表示饼图的起始角度
plt.axis('equal') #这行代码加入饼图不会画成椭圆
plt.title("乌克兰")

pl.tight_layout() #布局方法
pl.savefig('D:/项目数前10国分行业.png',dpi = 500) #dpi实参改变图像的分辨率
pl.show() #显示方法


©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。