(TIL) Matplotlib: Save plot to file

less than 1 minute read

It’s very straightforward to save a matplotlib figure to disk:

import matplotlib.pyplot as plt
# ...
# matplotlib code here.
# ...
plt.savefig('path/to/figure.ext')

Via SO.

Comments