matplotlib中scatter报错module 'matplotlib' has no attribute 'scatter'
程序员文章站
2022-03-29 17:53:23
...
错误:
D:\pyPro\graph_recognation\venv\Scripts\python.exe D:/pyPro/graph_recognation/studyNew/huigui/simple_liner_regression.py
Traceback (most recent call last):
File "D:/pyPro/graph_recognation/studyNew/huigui/simple_liner_regression.py", line 9, in <module>
plt.scatter(x_data,y_data)
AttributeError: module 'matplotlib' has no attribute 'scatter'
原因:
导入包时用的是
import matplotlib as plt
改为
import matplotlib.pyplot as plt
上一篇: 文件扩展名 一个取得文件扩展名的函数
推荐阅读
-
使用matplotlib中scatter方法画散点图
-
使用matplotlib中scatter方法画散点图
-
matplotlib中scatter报错module 'matplotlib' has no attribute 'scatter'
-
运行matplotlib出现:AttributeError: module ‘matplotlib‘ has no attribute ‘verbose‘
-
python-AttributeError: module 'matplotlib' has no attribute 'contourf'
-
解决 AttributeError: module 'matplotlib' has no attribute 'artist'
-
Ununtu---解决 AttributeError: module 'matplotlib' has no attribute 'artist'
-
AttributeError: module 'matplotlib' has no attribute 'artist'解决方案
-
【Python-BUG】module ‘matplotlib‘ has no attribute ‘plot‘
-
AttributeError: module 'matplotlib.mlab' has no attribute 'normpdf'