16

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 supported on this device: reported only once per page".

However, if I call x11(type="cairo"), everything works fine.

How do I get cairo as the default backend for x11?

signalseeker
  • 4,100
  • 7
  • 30
  • 36
  • 3
    See: `options('device')` – daroczig May 27 '12 at 20:34
  • I get the same behavior, and I think it must be a bug in `x11`. The documentation for the `type` parameter of `x11` says "The default is ‘"cairo"’ where available except on Mac OS X, otherwise ‘"Xlib"’. Clearly cairo is available, so it should be the default. – Maxy-B Jul 17 '13 at 04:23

2 Answers2

13

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')
Cyrus
  • 131
  • 1
  • 4
5

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

x11 = function (...) grDevices::x11(...,type='cairo')
Matthew Lundberg
  • 42,009
  • 6
  • 90
  • 112