ggplot error: ssh X11 forwarding

485 Views Asked by At

I am using ggplot over ssh and running into the following error:

ggplot(data) outputs the following error

X11 font -adobe-helvetica-%s-%s-*-*-%d-*-*-*-*-*-*-*, face 1 at size 9 could not be loaded

It appears this could be due to several issues. Is there anyone work around/solution? I'm using R-3.3.0

1

There are 1 best solutions below

0
Andrew J. Rech On

You can use the extrafont package to manage what font ggplot2 is using and potentially change this to something available on the system that is drawing the plot.

    require(extrafont)
    extrafont::font_import()  ## first time could take a while
    extrafont::loadfonts()
    ggplot_font <- extrafont::choose_font(c(“Helvetica", "Arial”))  ## or enter a system font that is available

Then add to your plot + theme(text = element_text(family = ggplot_font)

You can see what fonts are available after extrafont::loadfonts() using extrafont::fonttable()