# Exporting figures to static HTML

**URL:** <https://discourse.julialang.org/t/exporting-figures-to-static-html/125896>\
**Category:** Visualization\
**Tags:** makie, wglmakie\
**Created:** [February 14, 2025, 9:10am UTC](https://discourse.julialang.org/t/exporting-figures-to-static-html/125896 "2025-02-14T09:10:59Z")\
**Posts on this page:** 12\
**Page:** 2

<div class="post-metadata">

**Author:** ![asinghvi17](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/asinghvi17/32/8272_2.png) [@asinghvi17](https://discourse.julialang.org/u/asinghvi17)\
**Post date:** [February 25, 2025, 9:20pm UTC](https://discourse.julialang.org/t/exporting-figures-to-static-html/125896/21 "2025-02-25T21:20:18Z")

</div>

Awesome! BTW: you can plot the ODE solution directly, via:

```julia
fig, ax, plt = lines(sol; idxs = (1, 2, 3), axis = (; type = Axis3), plotdensity = 10000, color = 1:10000, colormap = :plasma, transparency = true)
```

---

<div class="post-metadata">

**Author:** ![langestefan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/langestefan/32/207923_2.png) [@langestefan](https://discourse.julialang.org/u/langestefan)\
**Post date:** [February 25, 2025, 9:32pm UTC](https://discourse.julialang.org/t/exporting-figures-to-static-html/125896/22 "2025-02-25T21:32:22Z")

</div>

thanks!

Thanks, I tried that, but for some odd reason I then lose the interactivity.

 ![afbeelding](https://global.discourse-cdn.com/julialang/original/3X/1/b/1b94b37cea0cc597bd9accede1b13140f21f07aa.jpeg)

---

<div class="post-metadata">

**Author:** ![sdanisch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sdanisch/32/1406_2.png) [@sdanisch](https://discourse.julialang.org/u/sdanisch)\
**Post date:** [February 26, 2025, 9:19am UTC](https://discourse.julialang.org/t/exporting-figures-to-static-html/125896/23 "2025-02-26T09:19:11Z")

</div>

because it changes the axis type, which isn’t implemented in js… if you remove that it should be back.

---

<div class="post-metadata">

**Author:** ![langestefan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/langestefan/32/207923_2.png) [@langestefan](https://discourse.julialang.org/u/langestefan)\
**Post date:** [February 26, 2025, 10:04am UTC](https://discourse.julialang.org/t/exporting-figures-to-static-html/125896/24 "2025-02-26T10:04:47Z")

</div>

Like this?

```julia
prob = ODEProblem(lorenz!, u0, tspan)
sol = solve(prob)
  
fig, ax, plt = lines(
    sol; idxs = (1, 2, 3), 
    plotdensity = 10000, 
    color = 1:10000, 
    colormap = :plasma, 
    transparency = true
)

```

 ![afbeelding](https://global.discourse-cdn.com/julialang/original/3X/f/b/fb5deb218f44fb37686cba6a9ce57b0174998f01.jpeg)

Then it becomes 2D and and the interactivity is still lost 😂

---

<div class="post-metadata">

**Author:** ![sdanisch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sdanisch/32/1406_2.png) [@sdanisch](https://discourse.julialang.org/u/sdanisch)\
**Post date:** [February 26, 2025, 11:26am UTC](https://discourse.julialang.org/t/exporting-figures-to-static-html/125896/25 "2025-02-26T11:26:21Z")

</div>

Oh, I guess recognizing the 3d output isn’t implemented for that recipe.  
You’ll need `axis = (; type = LScene)`.

---

<div class="post-metadata">

**Author:** ![sdanisch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sdanisch/32/1406_2.png) [@sdanisch](https://discourse.julialang.org/u/sdanisch)\
**Post date:** [February 26, 2025, 11:27am UTC](https://discourse.julialang.org/t/exporting-figures-to-static-html/125896/26 "2025-02-26T11:27:22Z")

</div>

Maybe worth opening an issue referencing:

> **[Recipes | Makie](https://docs.makie.org/stable/explanations/recipes#Full-recipes-with-the-%40recipe-macro)**
>
> Create impressive data visualizations with Makie, the plotting ecosystem for the Julia language. Build aesthetic plots with beautiful customizable themes, control every last detail of publication quality vector graphics, assemble complex layouts and...

`Makie.preferred_axis_type(plot::MyPlot)`

---

<div class="post-metadata">

**Author:** ![langestefan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/langestefan/32/207923_2.png) [@langestefan](https://discourse.julialang.org/u/langestefan)\
**Post date:** [February 26, 2025, 12:13pm UTC](https://discourse.julialang.org/t/exporting-figures-to-static-html/125896/27 "2025-02-26T12:13:53Z")

</div>

That works great!

That would be an issue in the Makie.jl repository?

---

<div class="post-metadata">

**Author:** ![sdanisch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sdanisch/32/1406_2.png) [@sdanisch](https://discourse.julialang.org/u/sdanisch)\
**Post date:** [February 26, 2025, 12:15pm UTC](https://discourse.julialang.org/t/exporting-figures-to-static-html/125896/28 "2025-02-26T12:15:04Z")

</div>

No, wherever the ODEProblem recipes live.

---

<div class="post-metadata">

**Author:** ![langestefan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/langestefan/32/207923_2.png) [@langestefan](https://discourse.julialang.org/u/langestefan)\
**Post date:** [February 26, 2025, 12:42pm UTC](https://discourse.julialang.org/t/exporting-figures-to-static-html/125896/29 "2025-02-26T12:42:49Z")

</div>

Seems to be here?

If it’s as simple as adding `Makie.preferred_axis_type(plot::MyPlot)` I could make a PR for that.

> <https://github.com/SciML/SciMLBase.jl/blob/master/ext%2FSciMLBaseMakieExt.jl>

---

<div class="post-metadata">

**Author:** ![asinghvi17](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/asinghvi17/32/8272_2.png) [@asinghvi17](https://discourse.julialang.org/u/asinghvi17)\
**Post date:** [February 27, 2025, 6:36pm UTC](https://discourse.julialang.org/t/exporting-figures-to-static-html/125896/30 "2025-02-27T18:36:59Z")

</div>

The issue here is that we return a PlotSpec…so `args_preferred_axis` doesn’t work.

---

<div class="post-metadata">

**Author:** ![langestefan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/langestefan/32/207923_2.png) [@langestefan](https://discourse.julialang.org/u/langestefan)\
**Post date:** [February 27, 2025, 7:14pm UTC](https://discourse.julialang.org/t/exporting-figures-to-static-html/125896/31 "2025-02-27T19:14:30Z")

</div>

Ok I’ll just make the issue then

---

<div class="post-metadata">

**Author:** ![langestefan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/langestefan/32/207923_2.png) [@langestefan](https://discourse.julialang.org/u/langestefan)\
**Post date:** [March 1, 2025, 11:48am UTC](https://discourse.julialang.org/t/exporting-figures-to-static-html/125896/32 "2025-03-01T11:48:57Z")

</div>

For reference: [Makie recipe does not support 3D output · Issue #947 · SciML/SciMLBase.jl · GitHub](https://github.com/SciML/SciMLBase.jl/issues/947)

[Previous page](https://discourse.julialang.org/t/exporting-figures-to-static-html/125896.md?page=1)
