PostScriptTrace错误

PostScriptTrace错误,r,vector-graphics,postscript,eps,grimport,R,Vector Graphics,Postscript,Eps,Grimport,我正在尝试使用GrImport函数将大脑的矢量图形导入R。插入以下函数时: PostScriptTrace("~/Dropbox/shared/Brain_mapping/Human-brain.ps", "~/Dropbox/shared/Brain_mapping/Human-brain.xml") 我得到这个错误: Error in PostScriptTrace("~/Dropbox/Natasha_shared/Brain_mapping/Human-brain.ps", : s

我正在尝试使用
GrImport
函数将大脑的矢量图形导入R。插入以下函数时:

PostScriptTrace("~/Dropbox/shared/Brain_mapping/Human-brain.ps", "~/Dropbox/shared/Brain_mapping/Human-brain.xml")
我得到这个错误:

Error in PostScriptTrace("~/Dropbox/Natasha_shared/Brain_mapping/Human-brain.ps",  : 
status 255 in running command 'gs -q -dBATCH -dNOPAUSE -sDEVICE=ps2write -sOutputFile=/dev/null -sstdout=~/Dropbox/Natasha_shared/Brain_mapping/Human-brain.xml captureHuman-brain.ps'

这似乎不是一个常规的PostScript错误,我有点困惑于为什么命令将设备设置为ps2write。ps2write生成PostScript作为其输出,我不明白您为什么要将PostScript输入转换为PostScript输出

它还将输出定向到/dev/null,因此这个命令似乎没有任何用处。哦,'-q'会抑制大多数错误消息,这在调试问题时没有帮助


您可以共享原始PostScript文件吗?

很可能矢量图形中有一堆字符,但这些字符不在字体目录中。一个可能对您有用的好办法是,您必须在命令行(而不是R中)上运行以下gs行:

之后,您将得到一个新的矢量文件,可以在R中使用,如下所示:

PostScriptTrace("nochar_Human-brain.ps", "nochar_Human-brain.xml")
PostScriptTrace("nochar_Human-brain.ps", "nochar_Human-brain.xml")