Flushing all current figures in matplotlib

matplotlib, python

Solution

You want to close the figures right? I wonder if the following helps?

import matplotlib.pyplot as plt
plt.close()

UPDATE: As @jorgeca says, to close all the figures try using `plt.close('all')`

Problem

Say I did ``` figure(1) plot(...) figure(2) plot(...) ``` and I want to create a third figure and show only that one. so that: ``` figure(1) plot(...) figure(2) plot(...) somemagicFuncToFlushFigures() figure(3) plot(...) show() ``` will only show the third figure. How do I do that?

Original source