我正在准备一篇论文,以便提交给一份期刊,要求矢量图形以EPS格式提交,所有文本在数字内转换为大纲。将文本转换为矢量轮廓有助于避免最终布局中的字体问题。日记账需求是可用的这里。
使用ggplot2可以很容易地在R中创建EPS图形
library(ggplot2)
ggsave(filename = "file.eps")或使用setEPS()和postscript设备,如前面所解释的这里
setEPS()
postscript("filename.eps")
plot(1:10)
dev.off()我的问题是:如何将数字中的文本转换为矢量轮廓?我已经在其他软件(例如Illustrator或InDesign)中找到了如何做到这一点的信息,但我想知道是否有一种方法可以直接在R中完成。
发布于 2016-02-23 14:20:53
使用发行版的包管理器安装ghostscript,如果您在linux或下载到windows中下(也有便携版),对于mac,您可能可以使用brew。然后从R gs中调用gs.exe或就像在这个问题上。
library(ggplot2)
data(diamonds)
gs.cmd <- "gs" # ghostscript executable
# gs.cmd <- "C:/path/to/gs.exe" # Windows
p <- qplot(x=carat, y=price, color=clarity, data=diamonds)
ggsave(p, filename="test.eps")
system(paste(gs.cmd,"-o test_outline.eps -dNoOutputFonts -sDEVICE=eps2write test.eps"))https://stackoverflow.com/questions/35578347
复制相似问题