Flushing all current digits in matplotlib

Let's say i did

figure(1) plot(...) figure(2) plot(...) 

and I want to create a third figure and show only it. so that:

 figure(1) plot(...) figure(2) plot(...) somemagicFuncToFlushFigures() figure(3) plot(...) show() 

only the third pattern will be displayed. How to do it?

+6
source share
1 answer

Do you want to close the numbers exactly? I wonder if the following helps?

 import matplotlib.pyplot as plt plt.close() 

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

+12
source

All Articles