1 2 3 4 5 6 7
import matplotlib as mpl mpl.use('Agg') import matplotlib.pyplot as plt plt.plot([5,1,2,3,4]) plt.savefig('plot.png')