def _savePlot(self, data, filename): import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt plt.plot(data) plt.savefig(filename)