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

JQuery Autocomplete without using label, value, id -

c++ - Accessing inactive union member and undefined behavior? -

JAVA - what is the difference between void and boolean methods? -