title: Matplotlib: how to show plot again?
body: <p>Let say I make a plot in <code>Ipython Notebook</code>, and after couples of cells, I want to render it again, so I can compare it with other plots. </p>
  
  <p>How can I do it?</p>
  
  <pre><code>a = [1,2,3,4]
  b = [3,4,5,6]
  fig = plt.plot(a, b,'-', color='black')
  </code></pre>
  
  <p>This would display the plot, but when I run <code>fig</code>, there is no plot output.</p>
  
  <p>I find this: <a href="https://stackoverflow.com/questions/22729206/matplotlib-show-figure-again">matplotlib show figure again</a>, but that seems pretty complex?</p>
  
  <p>UPDATE: This is what I end up with:</p>
  
  <pre><code>def simple_plot(ax = None):
      if ax is None:
          fig, ax = plt.subplots()
      a = [1,2,3,4]
      b = [3,4,5,6]
      plt.plot(a, b,'-', color='black')
      return fig
  
  fig = simple_plot() # This would plot
  fig # this would also plot
  </code></pre>
  
  <p>However, if I run <code>simple_plot()</code>, it would print twice.</p>