2017-10-13 69 views
2

我有R半透明問題(R版本3.3.2)。 我得到這個錯誤,當我嘗試:開羅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 
+0

哪個操作系統是什麼?相關:http://r.789695.n4.nabble.com/Error-in-svg-cairo-based-devices-are-not-supported-on-this-build-td3535907.html – tonytonov

+0

謝謝你的回答,我正在研究BioLinux/Ubuntu 14.04 LTS。 – Corend

+0

請發佈您的'sessionInfo()'? X11的doc條目聲明「如果系統編譯時不支持cairographics,只有[Xlib]可用」。所以也許你缺少系統庫?什麼是「功能」(「cairo」)?可能相關:https://stackoverflow.com/questions/13235100/empty-plot-in-r – tonytonov

回答

0

我終於找到了一種方法,使其工作:我卸載R

,它使用./configure --with-cairo重新安裝。

一切正常,現在我有:

> capabilities("cairo") 
cairo 
TRUE