0

I wrote the code below, but when I run the code I get the error:

TypeError: 'module' object is not callable 

my code is:

import numpy as np
import matplotlib as plt

n = 10

aa = [float(i) for i in range(1, n)]
a = np.squeeze(np.asarray(range(1, n)))
bb = -0.8*np.exp(-a/1.4) + 1.4*np.exp(-a/2.0) + 0.4*np.exp(-a/3.0)
b = np.squeeze(np.asarray(bb))

plt.figure()
plt.scatter(a, b)# I used different combinations of a, aa, bb and b. None of them worked.
plt.show()

1 Answer 1

3

You need the import line to be:

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

1 Comment

I cannot believe that I didn't notice that! It's time to sleep!

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.