Skip to content

Instantly share code, notes, and snippets.

@aakhmetz
Created April 12, 2017 08:39
Show Gist options
  • Save aakhmetz/7610e778dd4b8e9f77305a240ec8125c to your computer and use it in GitHub Desktop.
Save aakhmetz/7610e778dd4b8e9f77305a240ec8125c to your computer and use it in GitHub Desktop.
library("extrafont")
options(repr.plot.width=5,repr.plot.height=5)
plot(0:1)
assign("Figure1",recordPlot())
Sys.setenv(R_GSCMD = "C:/Program Files/gs/bin/gswin64.exe")
pdf("Figure1.pdf",width=5,height=5);
replayPlot(eval(as.name("Figure1")));
dev.off()
embed_fonts("Figure1.pdf",outfile="Figure1-embed.pdf")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment