当前位置:网站首页>Plot size and resolution with R markdown, knitr, pandoc, beamer
Plot size and resolution with R markdown, knitr, pandoc, beamer
2022-07-01 00:19:00 【Technology feast】
problem :
Doesn't fit on the slide by default, doesn't even print by any other means. Not suitable for slides by default , Not even by any other means .
Here's the .Rmd: Edit: it seems you have to use plot() in every chunk. This is a .Rmd: edit : It seems that you have to use... In every block plot().Second plot now prints. The second figure is now printed .
# Plot should show at high resolution```{r echo=FALSE, comment = ""}# load some datarequire(plyr)rbi <- ddply(baseball, .(year), summarise, mean_rbi = mean(rbi, na.rm = TRUE))``````{r}# plotplot(mean_rbi ~ year, type = "l", data = rbi)```# Second attempt```{r, fig.width = 2, fig.height = 2}plot(mean_rbi ~ year, type = "l", data = rbi)```# Third attempt```{r, out.width = 2, out.height = 2}plot(mean_rbi ~ year, type = "l", data = rbi)```# Fourth attempt```{r, out.width = '200px', out.height = '200px'}plot(mean_rbi ~ year, type = "l", data = rbi)```# Fifth attempt```{r, out.width = '\\maxwidth'}plot(mean_rbi ~ year, type = "l", data = rbi)```
Save that as test.Rmd
Then compile to tex using beamer: Save as test.Rmd
And then use test.Rmd
Compiled into tex:
knit("test.Rmd")system("pandoc -s -t beamer --slide-level 1 test.md -o test.tex")
Open test.tex
in RStudio and click "Compile PDF". stay RStudio Open in test.tex
, And then click “ compile PDF”.
I've read Yihui's documentation and hope I haven't missed something really obvious. I have read Yihui Of file , I hope I didn't miss anything very obvious .
Edit new code incorporating Yihui's suggestions. edit Include new codes suggested by Yihui .
```{r setup, include=FALSE}opts_chunk$set(dev = 'pdf')```# Plot should show at high resolution```{r echo=FALSE, comment = ""}# load some datarequire(plyr)rbi <- ddply(baseball, .(year), summarise, mean_rbi = mean(rbi, na.rm = TRUE))``````{r}# plotplot(mean_rbi ~ year, type = "l", data = rbi)```# Second attempt```{r, fig.width = 4, fig.height = 4}plot(mean_rbi ~ year, type = "l", data = rbi)```
sessionInfo()
R version 3.0.1 (16/05/2013)Platform: x86_64-pc-linux-gnu (64-bit)Local: [1] LC_CTYPE = en_US.UTF-8 LC_NUMERIC = C LC_TIME = C LC_COLLATE = C [5] LC_MONETARY=C LC_MESSAGES=C LC_PAPER=C LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=C LC_IDENTIFICATION=C attached base packages:[1] stats graphics grDevices utils datasets methods base other attached packages:[1] plyr_1.8 markdown_0.6 knitr_1.2 rCharts_0.3.51 slidify_0.3.52loaded via a namespace (and not attached): [1] RJSONIO_1.0-3 codetools_0.2-8 digest_0.6.3 evaluate_0.4.3 formatR_0.8 [6] grid_3.0.1 lattice_0.20-15 stringr_0.6.2 tools_3.0.1 whisker_0.3-2 [11] yaml_2.1.7
Solution :
Reference resources : https://stackoom.com/en/question/1DNFK边栏推荐
- IFLYTEK active competition summary! (12)
- 1175. 质数排列 / 剑指 Offer II 104. 排列的数目
- Lombok
- C language array interception, C string by array interception method (c/s)
- 8253A寄存器浅析
- CesiumJS 2022^ 源码解读[6] - 三维模型(ModelExperimental)新架构
- 网上开华泰证券的股票账户是否安全呢?
- 2022-2028 global plant peptone industry research and trend analysis report
- Warmup preheating learning rate "suggestions collection"
- Reason why wechat payment wxpaypubhelper V3 callback XML is empty
猜你喜欢
2022-2028 global encrypted external hard disk industry research and trend analysis report
Inventory the six second level capabilities of Huawei cloud gaussdb (for redis)
2022-2028 global herbal diet tea industry research and trend analysis report
Error 2059 when Navicat connects to MySQL
HP notebook disable touchpad after mouse is inserted
2022-2028 global rotary transmission system industry research and trend analysis report
SSM integration process (integration configuration, function module development, interface test)
When is it appropriate to replace a virtual machine with a virtual machine?
[NLP] [textcnn] text classification
76 page comprehensive solution 2022 for smart Logistics Park (download attached)
随机推荐
[UML] UML class diagram
The difference between union and union all in MySQL
Basic knowledge of Embedded Network - introduction of mqtt
Teach you how to use Hal library to get started -- become a lighting master
"Experience" my understanding of user growth "new users"
Redis - sentinel mode
NATs cluster deployment
leetcode 474. Ones and Zeroes 一和零(中等)
Pycharm is very fast to learn from installation to full armament. There are so many pictures because it is too detailed!
2022-06-30:以下golang代码输出什么?A:0;B:2;C:运行错误。 package main import “fmt“ func main()
Netease cloud sign in lottery? That year I could sign in for 365 days. No? Look.
5g smart building solution 2021
The girlfriend said: if you want to understand the three MySQL logs, I will let you heiheihei!
Excuse me, does Flink support synchronizing data to sqlserver
Tide - rust web framework based on async STD
To tell you the truth, ThreadLocal is really not an advanced thing
2022-2028 global ultra high purity electrolytic iron sheet industry research and trend analysis report
Redis - cache penetration, cache breakdown, cache avalanche
Thoughts on the future of data analysis in "miscellaneous talk"
CentOS install MySQL