When I imported matplotlib by using only import matplotlib
, whether the pyplot was imported or not.
Following is a code to show my problem :
import numpy as np
import matplotlib as plt
print(np.sin(180))
x_sin=np.arange(0, 3*3.14 ,0.1)
print(x_sin)
y_sin=np.sin(x_sin)
print(y_sin)
plt.pyplot.plot(x_sin,y_sin)
When I tried to run this code it gave me the error:
AttributeError: module 'matplotlib' has no attribute 'pyplot'