jzadra
jzadra

Reputation: 4284

ggsave() as svg fontconfig error

I'm trying to use ggsave() for a ggplot to save as an svg. When I do so, I get a fontconfig error. I have installed and updated both svglite and gdtools packages.

I'm on MacOS Sierra.

ggplot(diamonds, aes(x = cut, y = price)) + geom_boxplot() %>% 
ggsave(filename = "diamonds.svg")

Saving 11.6 x 5.32 in image
Error in match_family_(font, bold, italic) : 
  Fontconfig error: unable to match font pattern

Upvotes: 2

Views: 1149

Answers (1)

David Gohel
David Gohel

Reputation: 10675

Could you:

  1. Install/reinstall homebrew
  2. run in command line: brew install cairo
  3. In R install.packages("gdtools")

Upvotes: 3

Related Questions