我试图运行?text3d
中给出的示例,如下所示:
library(rgl)
open3d()
famnum <- rep(1:4, 8)
family <- c("serif", "sans", "mono", "symbol")[famnum]
font <- rep(rep(1:4, each = 4), 2)
cex <- rep(1:2, each = 16)
text3d(font, cex, famnum, text = paste(family, font), adj = 0.5,
color = "blue", family = family, font = font, cex = cex)
这会产生以下几种警告信息:
In rgl.texts(x = c(1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 3L, ... :
font family "serif" not found, using "bitmap"
我想使用另一种字体而不是位图,但它似乎会切换到位图,无论我提供的参数为family
,例如family = "FreeSans"
。不知道这是一个错误还是我做错了什么。这是在
R version 3.3.2 (2016-10-31)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux 9 (stretch)
with the following rgl version loaded:
[1] rgl_0.96.0
答案 0 :(得分:0)
问题的解决方案由此主题中的成员提供:https://stat.ethz.ch/pipermail/r-help/2017-March/thread.html#445777
要成功运行,需要安装FreeType和FTGL
sudo apt-get install libfreetype6-dev
sudo apt-get install libftgl-dev
然后使用
从R中重新安装rglinstall.packages("rgl", type="source")