Rstudio中的表示-使图像填充整个屏幕 [英] Rpresentation in Rstudio - Make image fill out the whole screen

查看:151
本文介绍了Rstudio中的表示-使图像填充整个屏幕的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用knitr在Rstudio中进行制图表达我有一张只有一张图片的幻灯片,我想填满整个屏幕/幻灯片.我该怎么办?

Making an Rpresentation in Rstudio with knitr I have a slide with just one picture, which I want to fill out the whole screen/slide. How do I do that?

以下.Rpres文档的第二张幻灯片设置为2000x2000像素,但仍只占据屏幕的一小部分:

The second slide of the following .Rpres-document is set to 2000x2000 pixels but it still only fills a small area of the screen:

first slide
======


Slide with plot which I want to fill the whole screen
========================================================
title: false
```{r, echo=FALSE,out.height="2000px",out.width="2000px"}
plot(cars)
```

这就是我写图片不填满整个屏幕"时的意思,红线绘制在屏幕上未被绘图填充的部分.

This is what I mean when I write that the picture does not "fill the whole screen", the red lines are drawn at parts of the screen which are not filled by the plot.

更新2016年11月

在Rstudio版本1.0.44中创建新的演示文稿时,选择"HTML Slidy"使我更容易控制大小.以下内容接近于我想要的全高清分辨率,并且操作非常简单:

Choosing "HTML Slidy" when creating a new presentation in Rstudio Version 1.0.44, gives me easier control of the size. The following is close to what i wanted on a full HD resolution, and very simple to do:

---
title: "Untitled"
output: slidy_presentation
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
```

## 

```{r pressure, fig.height=10, fig.width=19}
plot(pressure)
```

推荐答案

以下是设置整体演示文稿大小的方法: http://www.rstudio.com/ide/docs/presentations/displaying_and_distributing_presentations 默认值很小:960 * 700.

Here's the way to set the overall presentation size: http://www.rstudio.com/ide/docs/presentations/displaying_and_distributing_presentations The default is quite small: 960 * 700.

图形大小,输出大小和演示文稿大小之间的交互很棘手,我不是专家,但这似乎行得通.经过一番混乱后,这看起来还不错:

The interaction between the figure sizes, output sizes, and presentation sizes is tricky and I'm not an expert, but this seems to work ok. After some messing around, this looked alright:

first slide
======
width: 1920
height: 1080

Slide with plot which I want to fill the whole screen
========================================================
title: false
```{r myplot,echo=FALSE,fig.width=8,fig.height=4.5,dpi=300,out.width="1920px",out.height="1080px"}
plot(cars)
```

这篇关于Rstudio中的表示-使图像填充整个屏幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆