5

According to the Quarto docs, the figure below should be screen-width but instead it is just positioned at the left-hand side of the screen. How can I make it bigger? Adding #| layout-ncol: 1 doesn't help either.

screenshot of html document

---
title: "Test"
format: html
---

```{r}
#| column: screen
plot(pressure)
```
Julian
  • 6,586
  • 2
  • 9
  • 33
dufei
  • 2,166
  • 1
  • 7
  • 18

1 Answers1

4

The generated image is not big enough to fill the full screen. Try the out-width parameter to scale the image (docs). For best results, choose a vector-graphic format to ensure smooth scaling of the image.

```{r}
#| column: screen
#| out-width: 100%
#| fig-format: svg
plot(pressure)
```
tarleb
  • 19,863
  • 4
  • 51
  • 80
  • Thanks! I assumed `out-width` would be adjusted automatically. The bigger image doesn't look as crisp anymore though, even when I increase `fig-dpi`. Do you know a workaround for this too? – dufei Nov 17 '22 at 12:21
  • @dufei I'd try with `#| fig-format: svg` – tarleb Nov 17 '22 at 12:43
  • 1
    I tried but it doesn't change anything... the embedded image is still a png. What does work, however, is using the tried and tested knitr options: `knitr::opts_chunk$set(dev = "svglite")`. There should be a way to achieve this using Quarto options though, I think – dufei Nov 17 '22 at 12:55
  • 1
    @dufei: which Quarto version is running on your system? I'm running 1.2, and Quarto does produce an SVG with the above. – tarleb Nov 17 '22 at 12:58
  • 1
    Weird! My Quarto CLI version is 1.2.269 – dufei Nov 17 '22 at 12:59
  • Weird indeed. That might be worth a separate question and/or bug report. – tarleb Nov 17 '22 at 13:00
  • 1
    I'll file one, thanks for helping to narrow it down! – dufei Nov 17 '22 at 13:02