posted Aug 18, 2013, 2:59 PM by Teng-Yok Lee
[
updated Jan 2, 2021, 8:45 PM
]
Using matplotlib to plot figures in Python should be straightforward, right? Well, not so obvious in Windows if you want the following features:
- Easy to copy-and-paste (in order to transfer data with other windows)
- Support auto-complete.
- Support command history.
- Show the variables w/o print (for quick debugging)
- Show the C/C++ side input (if I want to call my own python libraries which are written C/C++ with Python binding).
- Can display matplotlib figures without Blocking.
The following tables summarizes the tests I went through. In my case, the Python is the native one for Windows. I also tested CYGWIN, which has bettern copy-and-paste hotkey. Nevertheless, matplotlib requires numpy, which is more complicated to build in cygwin (There is an unofficial installer for the native version). When using cygwin to run the native python, the integration does not work well. Lots of keyboard
features is gone.
My conclusion: Using Windows command prompt with iPython is best. The only drawback is that its copy-and-paste is not convenient. To make the windows command prompt easier to use, please Enable QuickEdit mode. Please see the references.
Update: Forget about these tests. Just use WinPython. Remember that it cannot be installed under system path (e.g. C:\windows, C:\Program Files, C:\Program Files (x86)). I installed it under my document folder. As the iPython is built with Qt, now I can plot charts in Eclipse interactively! (PS. I do not like its IDE since it will touch the registry).
|
work w/ matplotlib?
|
Auto complete?
|
History
|
Show variables w/o print?
|
Show the C/C++ side output?
|
cmd> python
|
Blocked
|
N
|
Y
|
Y
|
Y
|
cygwin> python -i
|
FAILED
|
N
|
N
|
Y
|
Y
|
IDLE
|
Blocked
|
Y
|
Y
|
Y
|
N
|
Eclipse
|
Blocked
|
N
|
N
|
Y
|
Y
|
Eclipse + WinPython
|
Non-Blocked
|
Y
|
Y
|
Y
|
Y
|
cmd> python -m IPython
|
Blocked
|
Y
|
Y
|
Y
|
Y
|
cygwin> python -i -m IPython
|
Blocked
|
N
|
N
|
N
|
Y
|
cmd> python -m IPython --matplotlib
|
Non-Blocked
|
Y
|
Y
|
Y
|
Y
|
cygwin> python -m IPython --matplotlib
|
FAILED
|
N
|
N
|
N
|
Y
|
|
|