title: Cannot manually close matplotlib plot window
body: <p>I'm running Python v2.7 and matplotlib v1.5.0 on Mac OS X Yosemite. Up to recently, I was able to run my script in the interactive interpreter, show a plot, and then manually kill the window. For example</p>
  
  <pre><code>import numpy as np
  x = np.arange(1,10)
  y = np.arange(1,10)
  plt.plot(x,y)
  plt.show()
  </code></pre>
  
  <p>This used to work fine. The window would close and I'd return to the prompt. However, now when I hit the red X to close the window, the window remains open. My command prompt returns and works fine, but the window is stuck and I see the spinning beach ball over it.</p>
  
  <p><a href="https://i.stack.imgur.com/mFupu.png" rel="noreferrer"><img src="https://i.stack.imgur.com/mFupu.png" alt="enter image description here"></a></p>
  
  <p>(Note that the cursor doesn't appear in the image, but you can see the red X is greyed out because I've hit close but it is stuck open).</p>
  
  <p>It's not until I run the script a second time that the first window closes, but then I'm stuck with a second open plot with the same problem. I'm a bit confused because this only happened recently. Up till now, the window would close fine. </p>
  
  <p>It's not a huge issue, because Python still runs and I can still make new plots, but I'm curious as to why the window would all of a sudden stick open. Any advice?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I solved the problem by switching the interactive backend. Either Qt4Agg or TkAgg as an interactive backend resolves the issue. But the question remains why the macosx and CocoaAgg backends show this behavior.</p>