天天看点

成功解决AttributeError: ‘JointGrid‘ object has no attribute ‘annotate‘

解决问题

Traceback (most recent call last):

 File "F:\test2021011.py", line 60, in <module>

   JointGridScatterPlot(col_nums02,data_frame)

 File "F:\site-packages\DataVisualize_Functions2D.py", line 222, in JointGridScatterPlot

   fg.annotate(stats.pearsonr)

AttributeError: 'JointGrid' object has no attribute 'annotate'

解决思路

属性错误:'JointGrid'对象没有'annotate'属性

解决方法

   fg=sns.JointGrid(x=cols[0],y=cols[1],data=data_frame,)

   fg=fg.plot_joint(plt.scatter,color='m',edgecolor='white')            

JointGrid类中没有该方法,建议升级或者更新包的版本。

继续阅读