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

Nova
  • 5,423
  • 2
  • 42
  • 62
  • did anyone come up with a solution to this? See also: https://community.rstudio.com/t/r-markdown-chunks-dpi-option-ignored-on-run-current-chunk/34038/4 and https://stackoverflow.com/questions/53884985/how-can-i-change-dpi-inline-code-output-in-notebook-rmarkdown – Herr Jemine Jun 28 '19 at 12:07
  • I'm experiencing the same issue, and I created a bug report here (using the reproducible example provided by @Nova): https://github.com/rstudio/rstudio/issues/11649. Make sure to give it a "thumbs up" so it gets attention. – itpetersen Jul 21 '22 at 17:00

0 Answers0