Issue
I have wrote the following code:
import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(0, 5, 100)
y = x**2
plt.plot(x, y)
plt.xlabel("X-axis")
plt.ylabel("Y-axis")
plt.title("graph of $x^2$")
plt.show()
When I run the code, it shows the following error:
I have installed NumPy, successfully, but still getting this warning. How can I get rid of this?
Solution
I was using two versions of python. Then I uninstalled both versions of it and installed the latest version of python 3.10.1 from https://www.python.org/. After this, installed pip Matplotlib and Numpy. Everything is fine now.
Answered By - Piyush Pandita
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.