diff --git a/_posts/2011-12-09-graphics.md b/_posts/2011-12-09-graphics.md index c6e4a15e67..5ce1e69200 100644 --- a/_posts/2011-12-09-graphics.md +++ b/_posts/2011-12-09-graphics.md @@ -75,6 +75,14 @@ list.files(system.file('enc', package = 'grDevices')) You probably need to set the encoding when you see a warning like this: `Warning: conversion failure on '' in 'mbcsToSbcs': dot substituted for `. +Another possibility is to use the `cairo_pdf` device instead of `pdf` (see [#436](https://github.com/yihui/knitr/issues/436)): + +{% highlight r %} +options(device = function(file, width = 7, height = 7, ...) { + cairo_pdf(tempfile(), width = width, height = height, ...) +}) +{% endhighlight %} + ## The Dingbats font According to the documentation of `pdf()`, the `useDingbats` argument can reduce the file size of PDF's which contain small circles. If you are using **knitr** in RStudio, this option is disabled by default. You may want to enable it by putting `pdf.options(useDingbats = TRUE)` in your source document if you have large scatter plots. See [#311](https://github.com/yihui/knitr/issues/311) for more comments and discussions.