这是一个简单的代码,它在与代码相同的目录中生成并保存绘图图像.现在,有没有办法可以将它保存在选择目录中?
import matplotlib import matplotlib.pyplot as plt fig = plt.figure() ax = fig.add_subplot(111) ax.plot(range(100)) fig.savefig('graph.png')
python matplotlib
matplotlib ×1
python ×1