# Saving figures in makie

**URL:** <https://discourse.julialang.org/t/saving-figures-in-makie/137814>\
**Category:** New to Julia\
**Tags:** plotting, makie\
**Created:** [June 26, 2026, 7:10am UTC](https://discourse.julialang.org/t/saving-figures-in-makie/137814 "2026-06-26T07:10:14Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![mahmah](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mahmah/32/214326_2.png) [@mahmah](https://discourse.julialang.org/u/mahmah)\
**Post date:** [June 26, 2026, 7:10am UTC](https://discourse.julialang.org/t/saving-figures-in-makie/137814/1 "2026-06-26T07:10:14Z")

</div>

Is there a recommended way to save a figure in makie, akin to using savefig in Matlab as a “.fig” file?

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)\
**Post date:** [June 26, 2026, 7:19am UTC](https://discourse.julialang.org/t/saving-figures-in-makie/137814/2 "2026-06-26T07:19:34Z")

</div>

No, because Makie figures contain lots of references to anonymous functions etc. due to observables and the compute graph and these don’t behave well under serialization. You could try if you can reload a figure serialized in one session with Julia’s default serialization, but I assume it won’t work well, or break at the slightest underlying change (Julia patch version, any package version change).

---

<div class="post-metadata">

**Author:** ![mahmah](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mahmah/32/214326_2.png) [@mahmah](https://discourse.julialang.org/u/mahmah)\
**Post date:** [June 26, 2026, 10:40am UTC](https://discourse.julialang.org/t/saving-figures-in-makie/137814/3 "2026-06-26T10:40:52Z")

</div>

Okay, thanks. I’ll add that my ambitions plan is to have some interactive scatter plot where users can click dots and listen to music associated to them. I thought it could be a matter of just loading a figure but maybe I need to load preprocessed data instead.

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)\
**Post date:** [June 26, 2026, 11:37am UTC](https://discourse.julialang.org/t/saving-figures-in-makie/137814/4 "2026-06-26T11:37:05Z")

</div>

You mean you wanted to do that without a julia session running? With a running julia, you could set up something like that, no need to save a figure.

---

<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:** [June 26, 2026, 12:05pm UTC](https://discourse.julialang.org/t/saving-figures-in-makie/137814/5 "2026-06-26T12:05:23Z")

</div>

You can either compile it as a program with GLMakie, or you may use export\_static with WGLMakie, and program some js:

> [@Static HTML Exports for Makie Proof of Concept](https://discourse.julialang.org/t/static-html-exports-for-makie-proof-of-concept/137597/7):
>
> some years ago I created a bunch of demos, using record\_states as well. Good for small things, not so much for heavy loaded data apps. [https://lazarusa.github.io/ClimateVisualisations/](https://lazarusa.github.io/ClimateVisualisations/) code: [GitHub - lazarusA/ClimateVisualisations: Climate visualisation apps · GitHub](https://github.com/lazarusA/ClimateVisualisations) Edit: all JSServe will now need to be Bonito smiley

With e.g. claude code, it could be quite easy to come up with the correct js to play a sound etc 😉

---

<div class="post-metadata">

**Author:** ![mahmah](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mahmah/32/214326_2.png) [@mahmah](https://discourse.julialang.org/u/mahmah)\
**Post date:** [June 26, 2026, 2:27pm UTC](https://discourse.julialang.org/t/saving-figures-in-makie/137814/6 "2026-06-26T14:27:22Z")

</div>

Thanks! Could be done with a running Julia. I guess I just need to split the pipeline and save some data instead of saving figs (which is what I’m used to do)

---

<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:** [June 26, 2026, 2:41pm UTC](https://discourse.julialang.org/t/saving-figures-in-makie/137814/7 "2026-06-26T14:41:43Z")

</div>

Where are you used to that? I guess _something_ must load the saved figure one way or the other?  
E.g. if its something like matlab, this means the user needs to have matlab installed to open the figure.  
The same with Makie and Julia would be a package with an `@main` entry point, where you open the figure. The user then already has julia (must be 1.12+) and runs:

```julia
julia -e "using Pkg; Pkg.add("url-to-your-package")
julia -m YourPackage

```

Your package will just be:

```julia
module YourPackage
using GLMakie

function @main(ARGS) 
   fig = ...
   wait(display(fig))
end
end

```

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)\
**Post date:** [June 26, 2026, 4:52pm UTC](https://discourse.julialang.org/t/saving-figures-in-makie/137814/8 "2026-06-26T16:52:31Z")

</div>

Sounds like experimental psychology which was completely matlab dominated when I did it

---

<div class="post-metadata">

**Author:** ![mahmah](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mahmah/32/214326_2.png) [@mahmah](https://discourse.julialang.org/u/mahmah)\
**Post date:** [June 26, 2026, 6:03pm UTC](https://discourse.julialang.org/t/saving-figures-in-makie/137814/9 "2026-06-26T18:03:48Z")

</div>

Thanks! I have seen @main before but didn’t try it; I’m used to running

```julia
include(“script.jl”); Mymodule.run()

```

or something like that. And that’s exactly the research field; the idea is to prepare something I could show later in a presentation. I think thatthis will do. The missing piece is how to play sound files when clicking on points or bars, but that challenge is a bit off topic I guess.

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)\
**Post date:** [June 27, 2026, 4:31pm UTC](https://discourse.julialang.org/t/saving-figures-in-makie/137814/10 "2026-06-27T16:31:10Z")

</div>

Something simple might be using `ffplay` from ffmpeg, which you can install through julia in the form of FFMPEG\_jll so it’s easy to reproduce

---

<div class="post-metadata">

**Author:** ![mahmah](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mahmah/32/214326_2.png) [@mahmah](https://discourse.julialang.org/u/mahmah)\
**Post date:** [June 27, 2026, 6:12pm UTC](https://discourse.julialang.org/t/saving-figures-in-makie/137814/11 "2026-06-27T18:12:05Z")

</div>

Thanks! I used PortAudio instead, it worked like a charm!
