ValueError: The number of FixedLocator locations (7), , does not match the number of ticklabels (6).

阅读 49

2022-03-11

        在用 Matplotlib 制作雷达图时,有时会报错

ValueError: The number of FixedLocator locations (7), usually from a call to set_ticks, does not match the number of ticklabels (6).

        原因在于对 numpy.array() 对象 labels、data 及numpy.linspace() 对象 angles 等进行封闭时,遗漏对象未予封闭,导致彼此不能对应,从而出现ValueError。

        解决方案:封闭遗漏对象即可。

精彩评论(0)

0 0 举报