Interactive matplotlib through Eclipse PyDev


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?

5/23/2017 12:00:45 PM

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)

5/13/2014 2:32:00 PM

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow