import matplotlib.pyplot as plt
plt.rcParams["font.family"] = 'Arial Unicode MS'
plt.rcParams['axes.unicode_minus'] = False
plt.figure(figsize=(6,6))
values = [4.7,30.8,24.6,18.6,16,5.3]
label = ['西北','华东','华北','中南','西南','其他']
explode = [0.01,0.01,0.01,0.01,0.01,0.01]
patches,l_text,p_text = plt.pie(values,explode=explode,labels=label,autopct='%1.2f%%')
for t in l_text:
t.set_size(14)
for l in p_text:
l.set_size(15)
plt.suptitle('2019年中国大数据企业业务区域布局',fontsize=16,y=0.93)
plt.legend(bbox_to_anchor=(-0.04, 1),borderaxespad=0,frameon=False)
plt.show()
如果想要一块分离出来:
可以通过设置explode的值。
import matplotlib.pyplot as plt
plt.rcParams["font.family"] = 'Arial Unicode MS'
plt.rcParams['axes.unicode_minus'] = False
plt.figure(figsize=(6,6))
values = [4.7,30.8,24.6,18.6,16,5.3]
label = ['西北','华东','华北','中南','西南','其他']
explode = [0.01,0.1,0.01,0.01,0.01,0.01]
patches,l_text,p_text = plt.pie(values,explode=explode,labels=label,autopct='%1.2f%%')
for t in l_text:
t.set_size(15)
for l in p_text:
l.set_size(15)
plt.suptitle('2019年中国大数据企业业务区域布局',fontsize=16,y=0.93)
plt.legend(bbox_to_anchor=(-0.04, 1), loc='upper left', borderaxespad=0,frameon=False)
plt.show()