0

Given the following line of code:

<<myrcodeplot, fig.pos="H", fig.height=4, fig.width=4, fig.cap="Example of a plot">>=

I would like to give the plot that is generated here a label, so that I can simply refer to the plot as such in my LaTeX document:

\ref{plot}
WoeIs
  • 1,083
  • 1
  • 15
  • 25
  • If you are using `knitr`, rather than Sweave, then maybe [this post](https://stackoverflow.com/questions/14991735/latex-figure-label-from-r-plot-using-knitr) or [this post](https://stackoverflow.com/questions/31926623/figures-captions-and-labels-in-knitr). – lmo Jun 11 '18 at 12:33
  • @lmo: Thank you, the first link you referred to used the `fig.lp="fig:"` argument which solved my problem. – WoeIs Jun 11 '18 at 12:37

0 Answers0