Skip to content

Commit

Permalink
closes #436: use cairo_pdf() to record graphics
Browse files Browse the repository at this point in the history
  • Loading branch information
yihui committed Oct 12, 2016
1 parent 15fa074 commit 5353f10
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions _posts/2011-12-09-graphics.md
Expand Up @@ -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 '<var>' in 'mbcsToSbcs': dot substituted for <var>`.

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.
Expand Down

0 comments on commit 5353f10

Please sign in to comment.