简体   繁体   English

Python IDLE 的绘图问题

[英]Plotting issue with Python IDLE

I am a beginner at python and am facing an issue with seeing plots in Python IDLE.我是 python 的初学者,在查看 Python IDLE 中的图时遇到了问题。 The code runs and I get the following answer.代码运行,我得到以下答案。

>>> plt.plot(x)
[<matplotlib.lines.Line2D object at 0x7f8d1c342550>]

The Python Launcher starts jumping as soon as the above response is obtained and continues jumping for about 1-2 minutes. Python Launcher一得到上述响应就开始跳跃,持续跳跃约1-2分钟。 I don't see any image btw.顺便说一句,我没有看到任何图像。 Any help will be appreciated.任何帮助将不胜感激。

plt.plot() creates the plots requested and returns to you said objects. plt.plot()创建请求的图并返回给你说的对象。 You can then interact with them to see what data they hold, or change their properties.然后,您可以与它们进行交互以查看它们持有哪些数据,或更改它们的属性。 For example, colour, line width, etc.例如,颜色、线宽等。

>>> line, = plt.plot(x)
>>> type(line)
<class 'matplotlib.lines.Line2D'>
>>> line.set_linewidth(5)

In order to see the plot , you need to call为了查看 plot ,您需要调用

plt.show()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM