title: Closing figures from previous sessions
body: <p>I am running a python code that produces some figures with Matplotlib and Pandas. After a few runs of the code, I am getting to following error:</p>
  <blockquote>
  <p>RuntimeWarning: More than 20 figures have been opened. Figures created
  through the pyplot interface (<code>matplotlib.pyplot.figure</code>) are retained
  until explicitly closed and may consume too much memory. (To control
  this warning, see the rcParam <code>figure.max_open_warning</code>)</p>
  </blockquote>
  <p>I think this is because I forgot to close the figures after each run of the code. I have tried</p>
  <pre><code>plt.close('all')
  </code></pre>
  <p>but it does not close the figures from previous sessions. Restarting the terminal (conda) did not help either.</p>