我想使用特殊字体生成 R 图,即 Cormorant-Garamond-Light(Cormorant-Light 也是可能的)。问题是它适用于所有其他字体,但对于这种字体,所有空格都被忽略。
library(ggplot2)
library(extrafont)
data = data.frame(read.table(file="PATH/TO/FILE"))
p = ggplot(data = data, aes(x = data[1], y = data[2]))
p = p + xlab("Time t/s")
p = p + ylab("Temperature T/°C")
p = p + theme(text = element_text(family = "Cormorant Garamond Light"))
编译后出现警告,内容如下:
1:在 grid.Call(L_textBounds, as.graphicsAnnot(x$label), ... 中:
字符 0x20 的字体宽度未知
生成的 pdf 文件如下所示(代码被缩短以使其阅读速度更快)上面代码的编译pdf https://i.stack.imgur.com/9RuoE.png
感谢您的潜在帮助!
None
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)