当前位置:网站首页>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边栏推荐
- Red Hat将在Project Atomic上运用容器负载服务器
- 2022-06-30: what does the following golang code output? A:0; B:2; C: Running error. package main import “fmt“ func main()
- How to edit special effects in VR panorama? How to display detailed functions?
- Error when starting PHP: [pool www] cannot get uid for user '@php_ fpm_ [email protected]’
- Cloud security daily 220630: the IBM data protection platform has found an arbitrary code execution vulnerability, which needs to be upgraded as soon as possible
- Netease cloud sign in lottery? That year I could sign in for 365 days. No? Look.
- When we look at the industrial Internet, we always look at it from the opposite of the consumer Internet
- 206页上海BIM技术应用与发展报告2021
- [designmode] factory pattern
- conv2d详解--在数组和图像中的使用
猜你喜欢
[designmode] factory pattern
2022-2028 global plant peptone industry research and trend analysis report
Detailed explanation of conv2d -- use in arrays and images
2022-2028 global rampant travel industry research and trend analysis report
Netease cloud sign in lottery? That year I could sign in for 365 days. No? Look.
2022-2028 global weight loss ginger tea industry research and trend analysis report
HP notebook disable touchpad after mouse is inserted
The girlfriend said: if you want to understand the three MySQL logs, I will let you heiheihei!
Software supply chain security risk pointing North for enterprise digitalization and it executives
Gateway service gateway
随机推荐
2022-2028 global ultra high purity electrolytic iron sheet industry research and trend analysis report
C WinForm program interface optimization example
2022-06-30:以下golang代码输出什么?A:0;B:2;C:运行错误。 package main import “fmt“ func main()
2022-2028 global elevator emergency communication system industry research and trend analysis report
Cesiumjs 2022 ^ source code interpretation [6] - new architecture of modelempirical
6-1 exploit -ftp exploit
Kubernetes ---- pod configuration container start command
What is SRM system and how to standardize the internal procurement process of the company
File reading and writing for rust file system processing - rust Practice Guide
lvm-snapshot:基于LVM快照的备份之准备工作
2022-2028 global mobile scanning radiology room industry survey and trend analysis report
2022-2028 global ICT test probe industry research and trend analysis report
Mysql database query optimization
[leetcode] [SQL] notes
Fh6908a negative pole turn off synchronous rectification analog low voltage drop diode control IC chip tsot23-6 ultra low power rectifier 1W power consumption < 100ua static replacement mp6908
Pycharm is very fast to learn from installation to full armament. There are so many pictures because it is too detailed!
Gateway service gateway
PS2 handle-1 "recommended collection"
5G智慧建筑解决方案2021
1175. prime number arrangement / Sword finger offer II 104 Number of permutations