[英]On plotting in HTML5 slides with knitr
Here is my problematic slide: 这是我有问题的幻灯片:
The plain text for this slide is 该幻灯片的纯文本为
# Title
```{r plot, echo=FALSE}
library("ggplot2")
x <- seq(-1,1,0.05)
y <- x^3/3-x^2 + rnorm(41,sd=0.1)
qplot(x,y)+geom_smooth()
```
- item 1
- item 2
And I want to: 我想:
Could you please give me some hints? 你能给我一些提示吗? Thank you. 谢谢。
You should take time to read the wonderful documentation provided for knitr
. 您应该花些时间阅读有关knitr
的精彩文档。
Without knowing your work flow to create the slides it is hard answer from the html5 end. 在不知道要创建幻灯片的工作流程的情况下,从html5端很难回答。
You are looking for fig.width
, fig.height
, fig.cap
, warning
and message
from the knitr
chunk options. 您正在从knitr
块选项中查找fig.width
, fig.height
, fig.cap
, warning
和message
。
```{r plot, echo=FALSE,fig.width = 3, fig.height = 3, fig.cap = '', warning = FALSE, message = FALSE, cache = FALSE}
library("ggplot2")
x <- seq(-1,1,0.05)
y <- x^3/3-x^2 + rnorm(41,sd=0.1)
qplot(x,y)+geom_smooth()
```
- item 1
- item 2
You will have to adjust the height and width to get the size that is suitable for slides 您将需要调整高度和宽度,以获取适合幻灯片的尺寸
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.