It is often necessary to save the results of plots in permanent storage. The reasons for that include exporting plots to other software, sharing the graphs, and creating posters or presentations. Another reason to save graphs is to preserve different versions of the same plot.
Saving plots to disk
Getting ready
Start Jupyter and run the following three commands in an execution cell:
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
How to do it…
To save a plot to disk, we use the savefig() function, as illustrated in the following code segment...