title: Saving a figure after invoking pyplot.show() results in an empty file
body: <p>The following example code generates a simple plot, then saves it to 'fig1.pdf', then displays it, then saves it again to 'fig2.pdf'. The first image looks as expected, but the second one is blank (contains a white square). What's actually going on here? The line <code>plt.show()</code> apparently messes something up, but I can't figure out what/how!</p>
  
  <pre><code>import numpy as np
  import matplotlib.pyplot as plt
  x = np.linspace(-1, 1, 100)
  y = x**2
  plt.plot(x,y)
  plt.savefig('fig1.pdf')
  plt.show()
  plt.savefig('fig2.pdf')
  </code></pre>