datatop8 = data_re[:8] fig = plt.figure(figsize=(15,6)) plt.subplots_adjust(wspace=0.35,hspace=0.5) n = 0 for i in datatop8['name'].tolist(): n += 1 c = plt.cm.BuPu_r(np.linspace(0,0.7,10))[n-1] axi = plt.subplot(2,4,n, projection = 'polar') datai = datatop8[['BMI_nor','leg_nor','arm_nor','age_nor']][datatop8['name']==i].T scorei = datatop8['final'][datatop8['name']==i] angles = np.linspace(0,2*np.pi,4,endpoint=False) #axi.plot(angles,datai,linestyle = '-',lw=1,color = c) plt.polar(angles, datai, 'o-', linewidth=1,color = c) axi.fill(angles,datai,alpha=0.5,color=c) axi.set_thetagrids(np.arange(0.0,360.0,90),['BMI','腿长/身高','臂长/身高','年龄']) axi.set_rgrids(np.arange(0.2,1.5,0.2),'--') plt.title('Top%i %s: %.3f\n' %(n,i,scorei)) 报错结果:The number of FixedLocator locations (7), usually from a call to set_ticks, does not match the number of ticklabels (2).
可视化报错出ValueError要怎么更改
于 2022-06-09 10:17:35 首次发布