title: Matplotlib: how to set the current figure?
body: <p>This is hopefully a simple question but I can't figure it out at the moment. I want to use matplotlib to show 2 figures and then use them interactively. I create the figures with:</p>
  
  <pre><code>import matplotlib
  import pylab as pl
  
  f1 = pl.figure()
  f2 = pl.figure()
  </code></pre>
  
  <p>and can use the MATLAB-like pyplot interface to plot and draw in both figures. With </p>
  
  <pre><code>current_figure = pl.gcf()
  </code></pre>
  
  <p>I can determine the currently active figure for the pyplot interface, depending on which figure I clicked in. Now I want to draw something to the first figure with the pyplot interface but the current figure can be either of them. So is there something like</p>
  
  <pre><code>pl.set_current_figure(figure)
  </code></pre>
  
  <p>or any workaround? (I know that I can use the object oriented interface but for interactive stuff just using commands like plot(x, y) is much nicer)</p>