1
根据documentationfig.retina
在knitr
中的默认值是1的数值。然后,我预计将设置保留为空(例如下面的示例1 )将产生与下面的示例2完全相同的图像,其中我指定fig.retina=1
。相反,我发现默认(#1)创建一个60kb的图像,并设置fig.retina=1
产生一个25kb的图像。在`knitr`块中使用`fig.retina`会导致意想不到的数字尺寸
也许明确设置fig.retina
覆盖其他设置或东西?有没有人有解释为什么留空块选项空白的结果是一个数字超过设置fig.retina=1
(这应该是默认值)的两倍?
---
title: "Untitled"
output:
html_document:
self_contained: false
---
```{r onefile_figretinaDefault}
#1. this is 60kb on disk
library(ggplot2)
ggplot(cars, aes(speed, dist)) + geom_point()
```
```{r onefile_figretina1, fig.retina=1 }
#2. this is 25kb on disk
ggplot(cars, aes(speed, dist)) + geom_point()
```
```{r onefile_figretina2, fig.retina=2 }
#3. this is 60kb on disk
ggplot(cars, aes(speed, dist)) + geom_point()
```
```{r onefile_figretinaNULL, fig.retina=NULL}
#4. this is 25kb on disk
ggplot(cars, aes(speed, dist)) + geom_point()
```
```{r onefile_figretina1_owNULL, out.width = NULL, fig.retina=1 }
#5. this is 25kb on disk
ggplot(cars, aes(speed, dist)) + geom_point()
```
是的,令人困惑!感谢您的澄清。 – ZRoss
我同意这些差异是令人困惑的,但它们仍然记录在案:http://rmarkdown.rstudio.com/authoring_migrating_from_v1.html –