I am using python and matplotlib.pyplot to produce various plots.
I am not making the plots show(), I am instead saving them using matplotlib.pyplot.savefig() and matplotlib.pyplot.clf()
As the code runs, X11 brings up a cascade of blank windows - 1 for every plot that I save - until the code has finished.
The code works and my plots are saved as desired, but the blank windows which appear while the code is running are annoying.
How can I stop this please?
Edit:
This happens on all of my code. I guess the only relevant code is what I already put:
matplotlib.pyplot.savefig('{0}.png' .format(index))
matplotlib.pyplot.clf()
Okay, after further invetigation, my problem only occurs if I have imported Gpy. Here is a simple example that shows my issue:
import numpy as np
import GPy
import matplotlib.pyplot as plt
x = np.arange(0,10,1)
for i in range(10):
fig = plt.figure()
plt.plot(x)
plt.savefig('test_{0}.png' .format(i))
plt.clf()
Of course now, I can just remove the import Gpy line if I don't need it.
My version of python is 2.7.3
plt.clfat the end. Isn'tplt.closewhat you actually want to do?