# 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:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![algunion](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/algunion/32/51630_2.png) [@algunion](https://discourse.julialang.org/u/algunion)\
**Post date:** [February 14, 2025, 4:53pm UTC](https://discourse.julialang.org/t/exporting-figures-to-static-html/125896/4 "2025-02-14T16:53:50Z")

</div>

Try using this script (adapted from WGLMakie docs to be compatible with your desired example):

```julia
using WGLMakie, Bonito, FileIO
WGLMakie.activate!()

mkpath("static/plot_html/interactive_plotting")
output_file = "static/plot_html/interactive_plotting/contour.html"

open(output_file, "w") do io
    println(
        io,
        """
<center>
"""
    )
    Page(exportable=true, offline=true)

    app = App() do
        n = 10
        volume = rand(n, n, n)
        fig, _, _ = contour(volume, figure=(size=(700, 700),))
        fig
    end
    show(io, MIME"text/html"(), app)

    println(
        io,
        """
</center>
"""
    )
end

```

---

_[View the full topic](https://discourse.julialang.org/t/exporting-figures-to-static-html/125896)._
