title: How to save a Seaborn plot into a file
body: <p>I tried the following code (<code>test_seaborn.py</code>):</p>
  
  <pre><code>import matplotlib
  matplotlib.use('Agg')
  import matplotlib.pyplot as plt
  matplotlib.style.use('ggplot')
  import seaborn as sns
  sns.set()
  df = sns.load_dataset('iris')
  sns_plot = sns.pairplot(df, hue='species', size=2.5)
  fig = sns_plot.get_figure()
  fig.savefig("output.png")
  #sns.plt.show()
  </code></pre>
  
  <p>But I get this error:</p>
  
  <pre><code>  Traceback (most recent call last):
    File "test_searborn.py", line 11, in &lt;module&gt;
      fig = sns_plot.get_figure()
  AttributeError: 'PairGrid' object has no attribute 'get_figure'
  </code></pre>
  
  <p>I expect the final <code>output.png</code> will exist and look like this:</p>
  
  <p><a href="https://i.stack.imgur.com/n6uXd.png" rel="noreferrer"><img src="https://i.stack.imgur.com/n6uXd.png" alt="enter image description here"></a></p>
  
  <p>How can I resolve the problem?</p>