通过Eclipse PyDev交互式matplotlib [英] Interactive matplotlib through Eclipse PyDev

查看:327
本文介绍了通过Eclipse PyDev交互式matplotlib的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是通过eclipse 的交互式matplolib线程的跟进,大约2年旧的,我想知道在此期间是否有任何进展。



我在Eclipse PyDev的控制台窗口中运行IPython控制台,但是我无法获得与matplotlib相同的交互式绘图功能,就像我在(Windows)命令提示符外部 Eclipse PyDev之间运行IPython一样。以下是两个比较:



A)在Eclipse PyDev外的shell中运行IPython



$ ol
  • 在Windows命令提示符下使用ipython --pylab运行IPython

  • 在IPython控制台中输入plot([1,2,3 ])。这将打开一个图形图窗口,IPython控制台准备好进一步的命令(无需关闭图形窗口)。

  • 例如,我可以输入xlabel ),这将更新我的图形窗口。

  • B)在Eclipse PyDev内的交互式控制台中运行IPython
    在Eclipse PyDev中的IPython交互式控制台中输入以下内容:


    1. from pylab import *

    2. plot([1,2,3]) - >图形窗口不显示。

    3. 我必须输入show()打开图形窗口。但现在的问题是,只要我保持图形窗口打开,IPython控制台就不会接受任何新的命令。

    4. 所以我关闭图形窗口,输入xlabel '年'),其次是show()。这将重新打开带有年的图形窗口作为我的轴标签,但是图形本身是空的,不再显示[1,2,3]数据。

    有了这个行为,A)明显优于B),但我希望继续在Eclipse PyDev中工作,因为我喜欢总是在我的屏幕上显示变量列表(无需运行一个命令来显示所有的变量,如运行IPython形成一个Windows shell)。使用Wicked Shell,如其他线程中所建议的,不起作用(IPython在Wicked Shell中无法正常工作)



    如何在Eclipse PyDev中配置IPython,以便它会显示相同的交互行为,就像我在Windows命令提示符下运行一样?

    解决方案

    您可以通过选择在PyDev首选项中的交互式控制台的GUI。



    Eclipse - >窗口 - >首选项 - > Pydev - > Interactive Console - >启用GUI事件循环集成。



    在我的情况下,我选择了PyQt(qt / qt4)


    This is a follow up to this interactive matplolib through eclipse thread which is about 2 years old, I was wondering if there has been any progress in the meantime.

    I am running the IPython console in a console window in Eclipse PyDev, but I am unable to get the same interactive plotting features with matplotlib as if I were to run IPython in a (Windows) command prompt outside Eclipse PyDev. Here is how the two compare:

    A) Running IPython in a shell outside Eclipse PyDev

    1. Run IPython in a Windows command prompt with "ipython --pylab"
    2. Within the IPython console enter "plot([1,2,3])". This will open a figure plot window and the IPython console is ready for further commands (without having to close the figure plot window).
    3. For example, I can enter "xlabel('years')" and this will update my figure plot window.

    B) Running IPython in an interactive console within Eclipse PyDev Enter the following in the IPython interactive console within Eclipse PyDev:

    1. "from pylab import *"
    2. "plot([1,2,3])" --> Figure plot window does not show up.
    3. I have to enter "show()" to open the figure plot window. But now the problem is that as long as I keep the figure plot window open, the IPython console does not accept any new commands.
    4. So I close the figure plot window, enter "xlabel('years')", followed by "show()" again. This will re-open the figure plot window with "years" as my axis label, but the plot itself is empty and does not show the [1,2,3] data anymore.

    With this behaviour, A) is clearly superior to B), but I would like to keep working in Eclipse PyDev because I like always having the variables list on my screen (without having to run a command to show all variables like when running IPython form a windows shell). Using Wicked Shell, as suggested in the other thread, does not work (IPython does not work properly in Wicked Shell).

    How can I configure IPython in Eclipse PyDev so that it shows the same interactive behavior as if I would run it in a windows command prompt?

    解决方案

    You can solve this problem by selecting a GUI for the Interactive Console in PyDev Preference.

    Eclipse -> Window -> Preferences -> Pydev -> Interactive Console -> Enable GUI event loop integration.

    In my case, I chose PyQt (qt/qt4)

    这篇关于通过Eclipse PyDev交互式matplotlib的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆