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

后端 未结 2 1622
孤城傲影
孤城傲影 2020-12-29 08:47

I am using ggplot2 on ubuntu 12.04. By default my x11 type is set to Xlib. So when I use a smoother in qplot, I get an error like:

\"semi-transparency is not support

相关标签:
2条回答
  • 2020-12-29 09:28

    Define another function 'x11' which sets the proper type:

    x11 = function (...) grDevices::x11(...,type='cairo')
    
    0 讨论(0)
  • 2020-12-29 09:30

    To make this permanent, you could add the following lines to your ~/.Rprofile file:

    setHook(packageEvent("grDevices", "onLoad"),
    function(...) grDevices::X11.options(type='cairo'))
    options(device='x11')
    
    0 讨论(0)
提交回复
热议问题