title: Matplotlib plots aren't shown when running file from bash terminal
body: <p>Plots are normally shown when I run files from the ipython shell or from an ipython notebook, but they don't show up when I run the file from a bash terminal -- everything else works fine when is run from a bash terminal. </p>
  
  <p>Sample python script (trial.py):</p>
  
  <pre><code>import matplotlib.pyplot as plt
  
  print 'please, show my graph'
  
  plt.plot([1,2,3], [1,2,3])
  
  plt.show()
  </code></pre>
  
  <p>This is what I get (plot doesn't show up):</p>
  
  <pre><code>[~/Desktop]$ python trial.py
  please, show my graph
  [~/Desktop]$
  </code></pre>
  
  <p>If I do</p>
  
  <pre><code>import matplotlib
  matplotlib.use('TkAgg')
  </code></pre>
  
  <p>before importing pyplot, then a window opens and closes immediately when I run it from the terminal.</p>
  
  <p>I've tried different ways of importing modules without success:</p>
  
  <pre><code>import matplotlib.pyplot as plt
  import matplotlib.pylab as plt
  from matplotlib import pyplot as plt
  from matplotlib import pylab as plt
  </code></pre>
  
  <p>I have the plt.show() function in my file. </p>
  
  <p>Do you know how I can fix it?</p>
  
  <p>Some info about versions and installation:</p>
  
  <p>I'm on a mac OSX 10.11.3.</p>
  
  <pre><code>In [61]: print matplotlib.__file__
  /usr/local/lib/python2.7/site-packages/matplotlib/__init__.pyc
  
  In [62]: print matplotlib.__version__
  1.4.2
  
  In [64]: print sys.version
  2.7.9 (default, Apr  7 2015, 07:58:25)
  [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)]
  
  In [65]: matplotlib.get_backend()
  Out[65]: u'MacOSX'
  </code></pre>