0

I've a plot in xmgrace which I would like to save separately from the main project as a pdf file. 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?

Thanks

Device setup for printing in xmgrace

1 Answers1

0

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). 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):

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). If you don't have epstopdf installed you can use any other software to do the conversion.

lr1985
  • 1,085
  • 1
  • 9
  • 21