Python绘制饼图
import matplotlib.pyplot as plt import numpy as np from pylab import mpl mpl.rcParams[‘font.sans-serif‘] = [‘STZhongsong‘] # 指定默认字体:解决plot不能显示中文问题 mpl.rcParams[‘axes.unicode_minus‘] = False x=[8566,5335,7310,6482] labels=["我的店铺1","我的店铺2","我的店铺3","我的店铺4"] explode=[0,0.08,0,0] labeldistance=1.1 plt.pie(x,labels=labels,autopct=‘%.2f%%‘,shadow=True,explode=explode,radius=1.0, labeldistance=labeldistance,pctdistance=0.6,startangle=360) plt.title("各店铺销量占比",loc="center") plt.show();