4

I am struggling to change the dpi in an RMarkdown notebook.

I like to use the notebook version of the output (nb.html), not the knitted version (html), with my colleagues, since it has the "show code" and "hide code" buttons.

Say I have the following text within an RMarkdown (Rmd) file.

---
title: "Test_Resolution"
author: " "
date: "September 7, 2017"
output:
  html_notebook: default
  html_document: default
---

```{r dpi=10, fig.height=4, fig.width=4}
plot(cars)
```

```{r dpi=300, fig.height=4, fig.width=4}
plot(cars)
```

In the knitted version, this is the result (note that the figure height and width is not 2 x 2, as I indicated in the chunk options. Why?)


enter image description here

In the notebook version, this is the result - no change in dpi. Is there any way currently to alter the dpi in the notebook version?


enter image description here

2

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.