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?
To update the plot with x and y values, we use ion() function. To plot the line, we use plot() function. To define labels, we use xlabel() and ylabel() function. Then we update the variables x and y with set_xdate() and set_ydata() function.
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')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With