0
import pandas as pd
import matplotlib as plt
import numpy as np

x = np.linspace(0,10,10)
y = np.sin(x)

plt.plot(x,y)

(most recent call last):

File "<ipython-input-18-d8b592bf313e>", line 1, in <module>
    plt.plot(x,y)

AttributeError: module 'matplotlib' has no attribute 'plot'
1
  • 1
    Perhaps you meant import matplotlib.pyplot as plt? Commented Mar 23, 2019 at 0:27

2 Answers 2

1

You need to import matplotlib.pyplot not matplotlib

import matplotlib.pyplot as plt
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for clarifying. :)
0

You need to import pyplot module from matplotlib package: import matplotlib.pyplot as plt

1 Comment

Thanks. Appreciated :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.