霍兰德人格分析雷达图生成报错ValueError:he number of FixedLoca和AttributeError: ‘Text‘ object has no property ‘frac‘

本文介绍了在生成霍兰德人格分析雷达图时遇到的两个Python错误:ValueError,提示FixedLocator位置数量与ticklabels数量不匹配,以及AttributeError,指出'Text'对象没有'frac'属性。解决这两个问题的方法是分别删除代码中红色矩形框1和2内的内容。修改后的代码成功运行并显示结果。
摘要由CSDN通过智能技术生成

霍兰德人格分析雷达图生成报错ValueError:he number of FixedLoca和AttributeError: 'Text' object has no property 'frac'


在这里插入图片描述

报错为: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
  • 7
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 4
    评论
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值