*** Update: the problem is with running python inside emacs on windows. ipython and elpy are off the hook. From a plain DOS prompt: python; from pylab import *; figure(1); show() works. If I start (windows-native) emacs with emacs -Q (turn off all customizations, so no elpy etc), then Alt-x run-python, I get a python (not ipython) prompt within emacs. from pylab import *; figure(1); show() doesn't work - no figure window appears, and I don't get back a python prompt.
*** Original post: Very annoying problem, have talked to elpy and matplotlib people but we are stumped.
Goal: run ipython as a process within emacs, and get matplotlib plots to work. Regarding OSes, "linux is nice but I prefer emacs".
My setup: Windows 7, Python packages thru Anaconda (python 3.6.2, ipython 6.1.0, matplotlib 2.0.2), emacs - 25.3 official GNU windows build (NOT cygwin, though I use the cygwin tools like grep, diff, etc in emacs), elpy emacs package for working with python.
Elpy has support for ipython. As long as I don't make a plot, this works fine - I can edit python files in emacs, send them to an ipython session, work in it. Also, outside of emacs if I just run ipython from a DOS prompt, matplotlib figures work fine (also work fine from Spyder).
I have made sure to revert to a plain vanilla setup - no config files, TkAgg matplotlib backend (those Qt gave similar but slightly different problems).
So: I start ipython within emacs, and do 'pylab'.
** plt.ion(), figure(1): window appears, with buttons on bottom. ipython prompt works. If I interact with the figure window, I get “not responding” in title, and MS Windows’ spinning shell. If I close the figure window by clicking on the X in upper right, windows says “app not responding.” Dialog box w/ End Process or Cancel. End process kills figure and ipython session.
** If instead plt.ioff(), figure(1): plot(1,1) show() I get a figure window with a plot, but if I interact with it I get “not responding.” ipython prompt seems fine. I can close window from prompt close(1) and ipython fine.
Tom Caswell (matplotlib) thinks it's an issue with the input hook. I don't know how to work with this, but maybe it's enough of a clue.
I'd think the 'Venn diagram' for people using python for science + emacs + Windows wouldn't be that small.