简体   繁体   English

关于使用Knitr绘制HTML5幻灯片

[英]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: 我想:

  1. Hide the comment text (## blahblah) 隐藏评论文本(## blahblah)
  2. Hide the text "plot of chunk plot" 隐藏文字“大块图的图”
  3. Make the plot smaller, so that the items can be shown 缩小图,以便显示项目

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.widthfig.heightfig.capwarningmessage

```{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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM