背景:
最近在使用matplot绘制等高线时,使用以下语句时,
plt.contourf(xx, yy, z,alpha=0.2) # 透明度alpha=0.2
一直报错,一直提示AttributeError: module 'contourpy' has no attribute 'contour_generator'。
解决办法:
卸载掉contourpy模块,可以使用以下命令:
pip uninstall contourpy
再重新安装contourpy模块,-i后面是清华的pip 源
pip install contourpy -i https://pypi.tuna.tsinghua.edu.cn/simple/
或者直接升级contourpy模块,这个作者未尝试,成功的可以在评论区留言。
解决Matplotlib中contourf报错:contourpy模块缺失的问题
文章讲述了在使用Matplotlib绘制等高线时遇到AttributeError,因为contourpy模块缺少contour_generator属性。解决方法是先卸载contourpy,然后通过清华大学的pip源重新安装或直接升级该模块。
832

被折叠的 条评论
为什么被折叠?



