R 网格错误。Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : 找不到多边形边

R Error in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : polygon edge not found

提问人:la.poubelle 提问时间:11/17/2023 最后编辑:la.poubelle 更新时间:11/17/2023 访问量:18

问:

每当我使用 ggplot 或任何像 pheatmap 这样的包时:

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

#or 

pheatmap(sampleDistMatrix,
         clustering_distance_rows=sampleDists,
         clustering_distance_cols=sampleDists,
         col=colors)

我收到以下错误:

Error in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y,  : 
  polygon edge not found

我还收到以下警告消息:

> warnings()
Warning messages:
1: In grid.Call(C_textBounds, as.graphicsAnnot(x$label),  ... :
  no font could be found for family "Arial"
2: In grid.Call(C_textBounds, as.graphicsAnnot(x$label),  ... :
  no font could be found for family "Arial"
3: In grid.Call(C_textBounds, as.graphicsAnnot(x$label),  ... :
  no font could be found for family "Arial"
4: In grid.Call(C_textBounds, as.graphicsAnnot(x$label),  ... :
  no font could be found for family "Arial"
5: In grid.Call(C_textBounds, as.graphicsAnnot(x$label),  ... :
  no font could be found for family "Arial"

我尝试遵循其他帖子的建议,例如(网格中的错误。Call(L_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : Polygon edge not found) 和谷歌上的其他几个,但没有任何效果。那时,我只是卸载并重新安装了 R studio,尝试删除我在 Apple Fontbook 中以某种方式拥有的所有重复的 Arial 字体,即使它不会让我完全删除它,并且只是显示重复项是“关闭”。Font book

从技术上讲,我可以尝试强制 ggplot 使用不同的字体,它并不能解决我在使用 pheatmap 等其他 R 包时遇到的问题,所以我真的很想解决根本问题。几天前,我能够为 R 工作室绘制绘图,但现在一切都停止工作并显示网格。调用错误。请帮忙!

其他一些可能有帮助的统计数据:

> ggplot2::theme_get()$text
List of 11
 $ family       : chr ""
 $ face         : chr "plain"
 $ colour       : chr "black"
 $ size         : num 11
 $ hjust        : num 0.5
 $ vjust        : num 0.5
 $ angle        : num 0
 $ lineheight   : num 0.9
 $ margin       : 'margin' num [1:4] 0points 0points 0points 0points
  ..- attr(*, "unit")= int 8
 $ debug        : logi FALSE
 $ inherit.blank: logi TRUE
 - attr(*, "class")= chr [1:2] "element_text" "element"


$serif
[1] "-*-times-%s-%s-*-*-%d-*-*-*-*-*-*-*"

$sans
[1] "-*-helvetica-%s-%s-*-*-%d-*-*-*-*-*-*-*"

$mono
[1] "-*-courier-%s-%s-*-*-%d-*-*-*-*-*-*-*"

$Times
[1] "-adobe-times-%s-%s-*-*-%d-*-*-*-*-*-*-*"

$Helvetica
[1] "-adobe-helvetica-%s-%s-*-*-%d-*-*-*-*-*-*-*"

$CyrTimes
[1] "-cronyx-times-%s-%s-*-*-%d-*-*-*-*-*-*-*"

$CyrHelvetica
[1] "-cronyx-helvetica-%s-%s-*-*-%d-*-*-*-*-*-*-*"

$Arial
[1] "-monotype-arial-%s-%s-*-*-%d-*-*-*-*-*-*-*"

$Mincho
[1] "-*-mincho-%s-%s-*-*-%d-*-*-*-*-*-*-*"


> systemfonts::font_info()
# A tibble: 1 × 24
  path         index family style italic bold  monos…¹ weight width kerning color scala…² verti…³ n_gly…⁴ n_sizes n_cha…⁵ bbox  max_a…⁶ max_d…⁷ max_a…⁸
  <chr>        <int> <chr>  <chr> <lgl>  <lgl> <lgl>   <ord>  <ord> <lgl>   <lgl> <lgl>   <lgl>     <int>   <int>   <int> <lis>   <dbl>   <dbl>   <dbl>
1 /System/Lib…     0 Helve… Regu… FALSE  FALSE FALSE   normal norm… FALSE   FALSE TRUE    FALSE      2252       0      10 <dbl>    9.23   -2.77      18
# … with 4 more variables: max_advance_height <dbl>, lineheight <dbl>, underline_pos <dbl>, underline_size <dbl>, and abbreviated variable names
#   ¹​monospace, ²​scalable, ³​vertical, ⁴​n_glyphs, ⁵​n_charmaps, ⁶​max_ascend, ⁷​max_descend, ⁸​max_advance_width
# ℹ Use `colnames()` to see all variable names


r ggplot2

评论


答: 暂无答案