【发布时间】:2017-04-26 01:06:38
【问题描述】:
自从更新到R 3.4 的新版本后,我在使用showtext 打印ggplot 时出现了一个新错误。
library(ggplot2)
library(showtext)
font.add.google("Lato")
p1 <- ggplot(diamonds, aes(depth, price)) +
geom_point() +
theme_minimal(base_family = "Lato")
这通常可以打印情节:
showtext.auto()
ggsave(plot = p1, "trial.pdf")
但是我得到了
Saving 5.2 x 5.83 in image
Error in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
invalid font type
In addition: There were 50 or more warnings (use warnings() to see the first 50)
这是我的SessionInfo()
【问题讨论】:
-
有趣——降级到以前的 R 版本解决了这个问题。
-
R 3.3.2 中的相同错误