title: Save plot to image file instead of displaying it using Matplotlib
body: <p>This displays the figure in a GUI:</p>
  <pre><code>import matplotlib.pyplot as plt
  plt.plot([1, 2, 3], [1, 4, 9])
  plt.show()
  </code></pre>
  <p>But how do I instead save the figure to a file (e.g. foo.png)?</p>