我试图使用python 3.3
在Matplotlib 1.3
中绘制非常简单的内容。以下是我正在尝试的代码:
import matplotlib.pyplot as plt
x = [1, 2, 3, 4, 5]
y = [1, 4, 9, 16, 25]
plt.plot(x,y)
我收到此消息:
matplotlib.lines.Line2D object at 0x0000000006711860
我刚开始使用python而且在python
世界中已经很新了。
答案 0 :(得分:0)
plt.plot
会返回lines.Line2D
个对象(因为您正在绘制一条线)。我猜你是在互动,否则你就不会看到“消息”。
如果您希望实际显示情节,则需要添加:
plt.show()