Answers for "plt.savefig close"

1

plt.savefig without showing

import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt

plt.plot([1,2,3])
plt.savefig('/tmp/test.png')
Posted by: Guest on October-06-2021

Python Answers by Framework

Browse Popular Code Answers by Language