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

Popular posts from this blog

javascript - backbone.js Collection.add() doesn't `construct` (`initialize`) an object -

php - Get uncommon values from two or more arrays -

Adding duplicate array rows in Php -