Skip to content

Similar feature to rstack, but for incremental plotting #12670

Answered by mcanouil
sandyspiers asked this question in Q&A
Discussion options

You must be logged in to vote

Why not use .r-stack? There is no need for something else.

I'm not an expert in Julia, but something like the code below should work:

---
format: revealjs
engine: julia
keep-md: true
---

```{julia}
#| output: none
using Plots
```

## Example 1

::: {.r-stack}

```{julia}
#| output: asis
p = plot()
for i in [1, 2, 3]
  plot!(p, [i], [i])
  print("\n::: {.fragment}\n")
  display(p)
  print("\n:::\n")
end
```

:::

## Example 2

::: {.r-stack}

```{julia}
#| output: asis
p = plot()
for i in [1, 2, 3]
  plot!(p, [i], [i])
  png(p, "plot$i.png")
  print("\n![](plot$i.png){.fragment}\n")
end
```

:::

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@sandyspiers
Comment options

Answer selected by sandyspiers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
revealjs Issues with the revealjs format julia
2 participants