使用RMarkdown的打印大小控制

使用RMarkdown的打印大小控制,r,knitr,R,Knitr,我需要制作一个pdf文档,其中包含许多详细的绘图。为了将文档文件大小保持在10MB以下,我尝试使用jpeg进行打印。但不管我怎么尝试,图片都会放大到全列宽,因此非常像素化 我应该使用什么设置来代替fig.width和fig.height 这是RStudio中包含的Tufte_讲义的修改版本。第三个情节是我需要更好的,但它应该看起来像第一个情节(只是更小) out.width,我也不推荐使用jpeg。如果必须使用光栅格式,png可能会更好。如果在创建后进行压缩,会怎么样? --- title: "

我需要制作一个pdf文档,其中包含许多详细的绘图。为了将文档文件大小保持在10MB以下,我尝试使用jpeg进行打印。但不管我怎么尝试,图片都会放大到全列宽,因此非常像素化

我应该使用什么设置来代替fig.width和fig.height

这是RStudio中包含的Tufte_讲义的修改版本。第三个情节是我需要更好的,但它应该看起来像第一个情节(只是更小)


out.width
,我也不推荐使用jpeg。如果必须使用光栅格式,png可能会更好。如果在创建后进行压缩,会怎么样?
---
title: "Tufte Handout"
author: "John Smith"
date: "August 13th, 2014"
output: rmarkdown::tufte_handout
---

# Normal plot

```{r, fig.cap = "Sepal length vs. petal length, colored by species"}
library(ggplot2)
qplot(Sepal.Length, Petal.Length, data = iris, color = Species)
```

# Smaller plot

```{r, fig.cap = "Sepal length vs. petal length, colored by species", fig.width=2, fig.height=2}
library(ggplot2)
qplot(Sepal.Length, Petal.Length, data = iris, color = Species)
```

# Smaller jpeg plot

```{r, dev='jpeg', fig.cap = "Sepal length vs. petal length, colored by species", fig.width=2, fig.height=2}
library(ggplot2)
qplot(Sepal.Length, Petal.Length, data = iris, color = Species)
```