I had to switch to a personal ubuntu PC lately. I already tried to get anti-alias in R outputs on my ubuntu workstation but failed and relied on an imac to get pixel perfect plot (ggplot2 <3). The latter one use QUARTZ by default and I tried to install quickly Cairo but it was not very simple and did not got time to fix it. Now that I have to, I did it. It is a minor problem and I am sure it will help other ubuntu R users (:
The problem is that :
install.packages("Cairo")outputs dependencie errors without telling explicitly how to fix them (particularylibxt)apt-get install r-cran-cairodoes install something but it does not appear in R and does not fetch dependencies either
Then in the terminal, you will first need to :
$ sudo apt-get install libcairo2 libcairo2-dev libxt-dev
Then in the R console :
install.packages('Cairo')
If you are using knitr directly or with R Studio, you will need to add an extra code at the beginning of your notebooks.
```{r global_setup, echo=FALSE, warning=FALSE, cache=FALSE}
opts_chunk$set(dev="CairoPNG")
```
normally cairo comes by default in
png(); did you install R byapt-get install r-base? (http://cran.r-project.org/bin/linux/ubuntu/)