I was wondering if it is possible to hide a graph with a button like you can do this with a code chunk using code-fold: true
. Is there a similar way for graphs? Here is a reproducible example:
---
title: "How to hide graph by button"
format:
html:
code-fold: true
engine: knitr
---
Example code:
```{r}
library(ggplot2)
ggplot(mtcars, aes(x = qsec, y = mpg)) + geom_point()
```
Output:
As you can see you can use a button called "Code" to hide the code chunk. Is there a way to do this only for the graph in Quarto
?