我需要制作一个包含许多细节的pdf文档。为了使文档文件大小保持在10MB以下,我尝试用jpeg绘图。但无论我如何尝试,图片都会升级到整列宽度,因此非常像素化。
我应该使用什么设置而不是fig.width和fig.height?
这是RStudio中包含的Tufte_handout的修改版本。第三个图是我需要的更好的图,但它应该看起来像第一个图(仅更小)。
---
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)
```