3

I have an issue with R semi-transparency (R version 3.3.2). I get this error when I try :

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

I tried 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?

But I still have the same error, I modified my .Rprofile, restarted but noway.

I don't know what kind of output would be usefull to help me fixing that.

Maybe :

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

Thank you very much if you have any clue, and let me know if I can show you other outputs.

Edit 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 
Corend
  • 343
  • 1
  • 3
  • 18
  • Which OS is that? Related: http://r.789695.n4.nabble.com/Error-in-svg-cairo-based-devices-are-not-supported-on-this-build-td3535907.html – tonytonov Oct 17 '17 at 08:52
  • Thank you for your answer, I am working on BioLinux / Ubuntu 14.04 LTS. – Corend Oct 17 '17 at 14:11
  • Please post your `sessionInfo()`? The doc entry for X11 states that "Only [Xlib] will be available if the system was compiled without support for cairographics." So maybe you are missing system libraries? What is `capabilities("cairo")`? Possibly related: https://stackoverflow.com/questions/13235100/empty-plot-in-r – tonytonov Oct 17 '17 at 14:46
  • I just edited my post, thank you again :-) – Corend Oct 18 '17 at 08:22

1 Answers1

3

I finally found a way to make it work :

I uninstalled R, reinstalled it using ./configure --with-cairo.

Everything works now and I have :

> capabilities("cairo")
cairo 
 TRUE 
Corend
  • 343
  • 1
  • 3
  • 18