Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Control size of figure in Rstudio presentation

I'm creating a presentation in RStudio (.Rpres). I have a figure that is too large and extends beyond the screen. How can I reduce it?

Too big, need to reduce size

Figure 1
========================================================
![alt text](fig1)
like image 322
Glen Avatar asked Apr 12 '15 22:04

Glen


2 Answers

You can use

```{r, echo=FALSE}
knitr::include_graphics(path,  dpi = NULL)
```

in a chunk and then set image height and width options in the chunk options. This should work with all output formats.

like image 68
Richard Telford Avatar answered Sep 28 '22 14:09

Richard Telford


This should work:

<div align="center">
<img src="fig1.jpg" width=800 height=600>
</div>

Simply adjust the width and height as required.

like image 28
Grant Avatar answered Sep 28 '22 12:09

Grant