0

I've been creating figures using python matplotlib and saving them into my Dropbox folder for a while now using:

import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages

plot = plt.figure(1)

Created figure....

plt.show()
pp=PdfPages("OutFileName.pdf")
pp.savefig(plot)
pp.close()

This worked for a really long time, and still works, as long as my Directory contains no spaces. However, the Dropbox settings have now changed and I have two Dropbox folders (Work and Personal). The directory is now: "~/Dropbox (Work)/MyFolder/'

Is there any way to work around this?

4

2 回答 2

0

您可以使用下划线。

plt.show()
pp=PdfPages("~/Dropbox_Work/MyFolder/Out_File_Name.pdf")
pp.savefig(plot)
pp.close()
于 2014-08-11T19:01:40.750 回答
0

我尝试创建一个没有空格的别名 Dropbox 文件夹,并将我的程序读入的目录替换为别名,但它仍然无法正常工作。这让我相信问题可能不在于空间,而在于 Dropbox。我重新启动计算机,一切都恢复正常运行。

于 2014-08-11T19:46:49.530 回答