I'm using ggplot2 in R to generate figures for a publication in which all figures need to be .eps format and all fonts needs to be Arial. I've been following this guide to doing this using the extrafont package. As I understand it, the line loadfonts(device = "postscript")
should register all of the fonts I imported (which includes Arial) with the postscript device. But when I run my code and try to save my figure using this code:
ggplot() + geom_point(aes(x=xvar, y=yvar)) + theme_minimal(base_family = "Arial")
library(extrafont)
font_import()
loadfonts(device = "postscript")
ggsave(filename = "myfile.eps")
I still get this error:
Error in grid.Call(L_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : family 'Arial' not included in postscript() device
What am I missing?