Trouble getting matplotlib to produce plots
Question: I can get matplotlib to work in pylab (ipython --pylab), but when I execute
the same command in a python script a plot does not appear. My workspace focus
changes from a fullscreened terminal to a Desktop when I run my script, which
suggests that it is trying to plot something but failing.

The following code works in `ipython --pylab` but not in my script.

    
    
    import matplotlib.pyplot as plt
    plt.plot(arange(10))
    

I am on Mac OS X Mountain Lion. **What is causing this to fail when I run a
script but not in the interactive prompt?**


Answer: I believe you need `plt.show()` .

