我是Knitr的新手.我试图用r块做一份报告,但我不知道以后如何使用标题和标签来引用这个图.
---
title: "Plotting"
author: "xx"
date: '2015-08-10'
output: pdf_document
---
```{r figs, echo=FALSE, fig.width=7,fig.height=6,fig.cap="plotting example"}
par(mfrow=c(2,2))
plot(1:10, col=2)
plot(density(runif(100, 0.0, 1.0)))
plot(runif(100, 0.0, 1.0),type="l")
```
in Figure \ref{fig:figs} we see examples of plotting in R.
我想有一个标题"Plotting example",并有一个标签,这样我就可以在文本中使用Figure\ref{fig.label}.我试过fig.cap和fig.lp,都不管用.