r - grid.Call 中出现错误(L_textBounds,as.graphicsAnnot(x$label),x$x,x$y,: Polygon edge not found

标签 r ggplot2

我刚刚在 Mac OS X 版本 10.7.3 上安装了 RStudio。 执行以下命令后

library(ggplot2)
qplot(mpg, wt, data=mtcars)

我收到以下错误:

Error in grid.Call(L_textBounds, as.graphicsAnnot(x$label), x$x, x$y,  : 
  Polygon edge not found
In addition: Warning messages:
1: In grid.Call(L_textBounds, as.graphicsAnnot(x$label), x$x, x$y,  :
  no font could be found for family "Arial"
2: In grid.Call(L_textBounds, as.graphicsAnnot(x$label), x$x, x$y,  :
  no font could be found for family "Arial"

如何解决这个问题?

最佳答案

这发生在我身上,我发现 arial 字体文件已被禁用。首先检查 Arial.ttf 是否已移至禁用字体目录。从终端:

ls /Library/Fonts\ Disabled

如果是这样,请将其移回事件字体目录。

sudo mv /Library/Fonts\ Disabled/Arial.ttf /Library/Fonts

注销,登录,然后打开“字体簿”应用程序。就我而言,arial 事先就存在,但它是存储在 /Library/fonts/Microsoft/ 中的 Microsoft 版本。字体册现在可能会在字体名称旁边显示一个黄色三角形,表示存在该字体的多个副本。突出显示字体名称,然后从编辑菜单中选择解决重复项命令。这应该会禁用 Microsoft 副本,您可以通过选择一种 arial 字体(单击字体名称旁边的展开三角形)来确认这一点,右键单击标记为 Off 的字体,然后选择 在 Finder 中显示,这将打开一个指向 Microsoft 字体目录的窗口。

关于r - grid.Call 中出现错误(L_textBounds,as.graphicsAnnot(x$label),x$x,x$y,: Polygon edge not found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10581440/

相关文章:

R:循环遍历 data.table 中的列

r - 控制不是ggplot中颜色指南的图例元素的颜色

r - ggplot2 binwidth 在 facet_wrap 直方图中没有响应

r data.table 条件和引用/从另一个单独的 data.table 执行查找

r - 使用 igraph 从顶点子集中提取连接子图

r - 如何更改ggplot2的geom_point中缺失值的颜色?

r - 将 "Overall"组添加到facet_wrap (ggplot2)

r - ggplot,更改每个 "color"的 alpha

r - 保持柱水恒定

r - 为什么乔列斯基分解不能得到与简单矩阵求逆相同的结果?