Python 霍兰德人格分析雷达图

### 霍兰德人格分析雷达图
import numpy as np
import matplotlib.pyplot as mplp
import matplotlib as mpl

mpl.rcParams['font.family']='SimHei'

### 雷达标签
STRNPLISTlabels = np.array(['研究型(I)','艺术型(A)','社会型(S)','企业型(E)','常规型(C)','现实型(R)'])
INTattr = 6
INTNPLISTdata = np.array([[0.40, 0.32, 0.35, 0.30, 0.30, 0.88],
 	                 [0.85, 0.35, 0.30, 0.40, 0.40, 0.30],
         	         [0.43, 0.89, 0.30, 0.28, 0.22, 0.30],
                 	 [0.30, 0.25, 0.48, 0.85, 0.45, 0.40],
           	         [0.20, 0.38, 0.87, 0.45, 0.32, 0.28],
                	 [0.34, 0.31, 0.38, 0.40, 0.92, 0.28]])                 #数据值
STRSETlabels = ('艺术家', '实验员', '工程师', '推销员', '社会工作者','记事员')
INTNPLISTangles = np.linspace(0, 2*np.pi, INTattr, endpoint=False)

INTNPLISTdata = np.concatenate((INTNPLISTdata, [INTNPLISTdata[0]]))
INTNPLISTangles = np.concatenate((INTNPLISTangles, [INTNPLISTangles[0]]))

MAPfig = mplp.figure(facecolor="white")
mplp.subplot(111, polar=True)
mplp.plot(INTNPLISTangles,INTNPLISTdata,'o-', linewidth=1, alpha=0.2)
mplp.fill(INTNPLISTangles,INTNPLISTdata, alpha=0.25)
mplp.thetagrids(INTNPLISTangles*180/np.pi, STRNPLISTlabels,frac = 1.2)
mplp.figtext(0.52, 0.95, '霍兰德人格分析', ha='center', size=20)

MAPlegend = mplp.legend(STRSETlabels, loc=(0.94, 0.80), labelspacing=0.1)

mplp.setp(MAPlegend.get_texts(), fontsize='large')
mplp.grid(True)
mplp.savefig('霍兰德人格分析雷达图.jpg')
mplp.show()

你可能感兴趣的:(Python)