霍兰德人格分析雷达图生成报错ValueError:he number of FixedLoca和AttributeError: 'Text' object has no property 'frac'
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/ddb5f9f81ddc7549fb783669105c8fd8.png)
报错为:ValueError: The number of FixedLocator locations (7), usually from a call to set_ticks, does not match the number of ticklabels (6).
则只需删除红色矩形框1中的内容
如果报错为:AttributeError: ‘Text’ object has no property ‘frac’
则只需要删除红色矩形框2中的内容
修改后的完整代码如下:
#DrawHollandRadar.py
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
matplotlib.rcParams['font.family']='SimHei'
matplotlib.rcParams['font.sans-serif']=['SimHei']
radar_labels = np.array(['研究型(I)','艺术型(A)','社会型(S)',\
'企业型(E)','常规型(C)','现实型(R)']) #雷达标签
nAttr = 6
data = np