Scatter error in matplotlib module'matplotlib' has no attribute'scatter'

created at 11-22-2021 views: 31

error

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'

reason

When importing the package, I used

import matplotlib as plt

to

import matplotlib.pyplot as plt
created at:11-22-2021
edited at: 11-22-2021: