5
我想使用Matplotlib。我之前在工作中使用過它,它運行得很好。我正在使用IDLE環境,並且我在Matplotlib網站上閱讀了交互模式在IDLE中不起作用的情況,但在這種情況下這應該不重要。此外,庫似乎導入就好了:Matplotlib只是給出錯誤信息
>>> import numpy as np
>>> import matplotlib as plt
>>> x = np.arange(0,3 * np.pi, 0.1)
>>> y = np.sin(x)
>>> plt.plot(x,y)
Traceback (most recent call last):
File "<pyshell#7>", line 1, in <module>
plt.plot(x,y)
AttributeError: 'module' object has no attribute 'plot'
>>> plt.show()
Traceback (most recent call last):
File "<pyshell#8>", line 1, in <module>
plt.show(x,y)
AttributeError: 'module' object has no attribute 'show'
美麗!謝謝! –
您將在一分鐘左右即可獲得答案積分。 –