Published
- 1 min read
plt.savefig without showing
The solution for this is noted below
plt.savefig without showing
Solution
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
plt.plot([1,2,3])
plt.savefig('/tmp/test.png')
Try other methods by searching on the site. That is if this doesn’t work