我的目标是在 LyX 中包含一个knitr图,我可以在我的文档中交叉引用。我:
- 插入了浮动图像。
- 添加了标题和标签。
- 在浮动图像中插入了 ERT 而不是图像。
我所做的图片如下:
我在这里检查过类似的问题,但没有人做我所做的事情,所以我在这里问:
- 有没有更简单的方法来完成我正在做的事情?
- 如何使 knitr 图像居中?
我的图像的代码是:
<<echo=FALSE>>=
dat <- data.frame(x=rnorm(100), y1=rnorm(100)-1, y2=rnorm(100), y3=rnorm(100)+1)
windows()
plot(y1 ~ x, data=dat, type='n', axes=FALSE, xlab="", ylab="")
text(dat$x,dat$y1,label=round(runif(100,0,100),0),col='blue', cex = abs(rnorm(100,0,1)))
text(dat$x,dat$y2,label=round(runif(100,0,100),0),col='purple', cex = abs(rnorm(100,0,1)))
text(dat$x,dat$y3,label=round(runif(100,0,100),0),col='red', cex = abs(rnorm(100,0,1)))
@
感谢您查看这个。感谢您的宝贵时间。