【问题标题】:Semi-transparency in R-3.3.2 issue with Cairo开罗 R-3.3.2 问题的半透明性
【发布时间】:2017-10-13 10:06:28
【问题描述】:

我对 R 半透明(R 版本 3.3.2)有疑问。 尝试时出现此错误:

ggplot(iris, aes(x = factor(Species), y = Sepal.Length, fill = Species)) +
+   geom_boxplot(alpha = 0.4)

Warning messages: 
1: In grDevices::x11(..., type = "cairo") :
  cairo-based types are not supported on this build - using "Xlib" 
2: In grid.Call.graphics(L_polygon, x$x, x$y, index) : 
  semi-transparency is not supported on this device: reported only once per page

我试过http://tinyheero.github.io/2015/09/15/semi-transparency-r.html

How to set cairo as default backend for x11() in R?

Semi-transparency in RStudio

How do I preserve transparency in ggplot2?

但我仍然有同样的错误,我修改了我的.Rprofile,重新启动但没有。

我不知道什么样的输出可以帮助我解决这个问题。

也许:

options('device')
$device
[1] "x11"

如果您有任何线索,非常感谢,如果我可以向您展示其他输出,请告诉我。

编辑 1:

>sessionInfo()
R version 3.3.2 (2016-10-31)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 14.04.5 LTS

locale:
 [1] LC_CTYPE=fr_FR.UTF-8       LC_NUMERIC=C               LC_TIME=fr_FR.UTF-8        LC_COLLATE=fr_FR.UTF-8    
 [5] LC_MONETARY=fr_FR.UTF-8    LC_MESSAGES=fr_FR.UTF-8    LC_PAPER=fr_FR.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=fr_FR.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] Cairo_1.5-9


>capabilities("cairo")
    cairo 
    FALSE 

【问题讨论】:

  • 那是哪个操作系统?相关:r.789695.n4.nabble.com/…
  • 感谢您的回答,我正在开发 BioLinux / Ubuntu 14.04 LTS。
  • 请张贴您的sessionInfo()? X11 的文档条目指出“如果系统在不支持 cairographics 的情况下编译,则只有 [Xlib] 可用。”所以也许你缺少系统库? capabilities("cairo") 是什么?可能相关:stackoverflow.com/questions/13235100/empty-plot-in-r
  • 我刚刚编辑了我的帖子,再次感谢您:-)

标签: r ggplot2 x11 cairo


【解决方案1】:

我终于找到了让它工作的方法:

我卸载了R,使用./configure --with-cairo重新安装。

现在一切正常,我有:

> capabilities("cairo")
cairo 
 TRUE 

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-06-01
    • 2014-01-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多