I'm doing my manuscript plots using R. The journal require all the text, labels, numbeirng of the plots in 8 pt size. Reading, I found that using pdf()
command, I can select the point size and the plot size too. However, the .pdf
file is not generated and I got the error:
我正在使用R来做我的手稿图。该期刊需要8磅大小的所有文本,标签,数字。阅读,我发现使用pdf()命令,我也可以选择点大小和绘图大小。但是,没有生成.pdf文件,我收到错误:
Error in pdf(file = "test.pdf", width = 5, height = 5, pointsize = 8) : cannot open file 'test.pdf'
pdf中的错误(file =“test.pdf”,width = 5,height = 5,pointsize = 8):无法打开文件'test.pdf'
I think that I'm doing something wrong. How can I export the file succesfully?
我认为我做错了什么。如何成功导出文件?
pdf(
file = "test.pdf",
width = 5,
height = 5,
pointsize = 8
)
plot(1:10)
dev.off()
1 个解决方案
#1
1
It sounds like an OS issue. Make sure a file test.pdf does not already exist or that you do not have it open. I was able to replicate the error only when I had the existing file opened.
这听起来像操作系统问题。确保文件test.pdf尚不存在或者您没有打开它。只有在打开现有文件时才能复制错误。
To avoid it in the future, I usually add datetime stamps to the end of my filenames.
为了避免将来出现这种情况,我通常会在文件名末尾添加日期时间戳。
#1
1
It sounds like an OS issue. Make sure a file test.pdf does not already exist or that you do not have it open. I was able to replicate the error only when I had the existing file opened.
这听起来像操作系统问题。确保文件test.pdf尚不存在或者您没有打开它。只有在打开现有文件时才能复制错误。
To avoid it in the future, I usually add datetime stamps to the end of my filenames.
为了避免将来出现这种情况,我通常会在文件名末尾添加日期时间戳。