python - Save matplotlib file to a directory -
here simple code generates , saves plot image in same directory of code. now, there way through can save in directory of choice?
import matplotlib import matplotlib.pyplot plt fig = plt.figure() ax = fig.add_subplot(111) ax.plot(range(100)) fig.savefig('graph.png')
according docs savefig accepts file path, need specify full (or relative) path instead of file name.
Comments
Post a Comment