import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt plt.plot([1,2,3]) plt.savefig('/tmp/test.png')
import matplotlib.pyplot as plt plt.pie([1,2,3]) plt.savefig('name')