简体   繁体   English

如何将在 xmgrace 中生成的图形打印到 pdf 文件中?

[英]How to print into a pdf file a graph generated in xmgrace?

I've a plot in xmgrace which I would like to save separately from the main project as a pdf file.我在 xmgrace 中有一个 plot,我想将其与主项目分开保存为 pdf 文件。 The thing is that when I'm in the print setup selecting the Device there is no pdf option just the usual X11, PostScript, JPE, PNG, etc. Is there some way I can save graphs with a .pdf extension?问题是,当我在打印设置中选择设备时,没有 pdf 选项只有通常的 X11、PostScript、JPE、PNG 等。有什么方法可以用.pdf扩展名保存图形?

Thanks谢谢

Device setup for printing in xmgrace在 xmgrace 中进行打印的设备设置

For reasons unknown to me, some xmgrace pre-compiled binaries don't come with the "print to PDF" option (Ubuntu's binary is one example).出于我不知道的原因,一些 xmgrace 预编译的二进制文件没有附带“打印到 PDF”选项(Ubuntu 的二进制文件就是一个例子)。 In this case you either re-compile xmgrace (enabling the PDF output) or use a combination of commands to generate an eps and then convert it to pdf. This is what I use (with a Linux distro):在这种情况下,您要么重新编译 xmgrace(启用 PDF 输出),要么使用命令组合生成 eps,然后将其转换为 pdf。这就是我使用的(带有 Linux 发行版):

f=my_file
base=${f%.*}
LANG= xmgrace -hardcopy -hdevice EPS $f -printfile $base.eps
epstopdf $base.eps --outfile=$base.pdf
rm $base.eps

The LANG= is there to avoid localisation issues (with some locales the comma is used in place of the dot as decimal separator and I don't want that). LANG=是为了避免本地化问题(在某些语言环境中,逗号用于代替点作为小数点分隔符,我不希望这样)。 If you don't have epstopdf installed you can use any other software to do the conversion.如果您没有安装epstopdf ,您可以使用任何其他软件进行转换。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM