【发布时间】:2016-03-12 09:15:39
【问题描述】:
我正在尝试使用 Matplotlib。我以前在工作中使用过它,它运行得很好。我正在使用 IDLE 环境,我在 Matplotlib 网站上读到交互模式在 IDLE 中不起作用,但在这种情况下这无关紧要。此外,该库似乎可以很好地导入:
>>> 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'
【问题讨论】:
标签: python python-2.7 matplotlib