title: How to create multiple figures without showing them until plt.show is called?
body: <p>I'd like to be able to independently create multiple figures with different graphs and choose whether they will be displayed in the GUI and or instead instead saved using the <code>plt.savefig()</code> function. (Most of the time I think I want them all to be displayed AND saved or none to be displayed only saved)</p>
  
  <p>I am trying to create a function called <code>plotData(channel, refFile)</code> which gets passed a a couple of parameters and creates a matplotlib figure and plots some data to it. I do not want the figure to be shown until I call another function <code>showPlot(channel)</code> which would show a the corresponding figure when called.</p>
  
  <p>Unfortunately whenever I use the plt.figure() function it automatically displays the figure. I've seen some answers from similar questions where people try something like <code>plt.figure(visible=False)</code> or <code>plt.figure('visibility', 'off')</code> but neither of these worked for me.</p>
  
  <pre><code>def plotData(self, chan, refFile):
  
      #create figure without showing the gui window
      self.figure[chan-1]=plt.figure()
  
      #plot data to graph
      sigPlot, =plt.plot(self.time[chan-1],self.yAxis[chan-1], label='Measured Signal')
      refPlot,= plt.plot(self.time[chan-1],self.refSig[chan-1], label='Reference Signal')
      plt.legend(handles=[sigPlot, refPlot])
  
  def showPlot(self,chan):
      self.figure[chan-1].show()
  
  
  def savePlot(self, filename):
      plt.savefig(filename, bbox_inches='tight')
  </code></pre>
  
  <p>Also how would do I save a particular plot? I don't mind if I always have to simply call the save figure plot function before creating the same plot.</p>