title: Object-oriented pyplot
body: <p>I need to handle the pyplot objects, like figures and axes. Here is a simplified example of what I want:</p>
  
  <pre><code>In [1]: import matplotlib.pyplot as mp
  
  In [2]: fig = mp.figure()             # create a figure
  
  In [3]: mp.show()                     # and immediately show it. And close.
  
  In [4]: ax = fig.add_subplot(111)     # Then I create a plot on that figure
  
  In [5]: ax.plot([1, 2, 3]) 
  Out[5]: [&lt;matplotlib.lines.Line2D at 0x104e29a50&gt;]
  
  In [6]: mp.get_fignums()              # But I already released the figure, so it doesn't appear in the list of available figures
  Out[6]: []
  
  In [7]: fig.axes[0].lines[0].get_data()   # The data is there, on the plot
  Out[7]: (array([ 0.,  1.,  2.]), array([1, 2, 3]))
  
  In [8]: mp.show()                     # But mp.show() shows nothing.
  </code></pre>
  
  <p>The fig.show() doesn't work too. How to show a figure after releasing it?</p>
  
  <p>UPD: There was a similar question: <a href="https://stackoverflow.com/questions/9621017/matplotlib-re-open-a-closed-figure">Matplotlib: re-open a closed figure?</a>, but with no answer.</p>