Answers for "plt.savefig without showing"

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
3

plt.savefig

import matplotlib.pyplot as plt
plt.pie([1,2,3])
plt.savefig('name')
Posted by: Guest on September-01-2020

Python Answers by Framework

Browse Popular Code Answers by Language