# Setting \`pt\_per\_unit\` in GLMakie for animation

**URL:** https://discourse.julialang.org/t/setting-pt-per-unit-in-glmakie-for-animation/107063
**Category:** Visualization
**Tags:** plotting, makie, glmakie
**Created:** [December 2, 2023, 11:54pm UTC](https://discourse.julialang.org/t/setting-pt-per-unit-in-glmakie-for-animation/107063 "2023-12-02T23:54:36Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![yhchang96](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yhchang96/32/36499_2.png) [@yhchang96](https://discourse.julialang.org/u/yhchang96)
#### Post date: [December 2, 2023, 11:54pm UTC](https://discourse.julialang.org/t/setting-pt-per-unit-in-glmakie-for-animation/107063/1 "2023-12-02T23:54:37Z")

</div>

With the recent update to `GLMakie`, I know we can set set `pt_per_unit` while saving figure created by GLMakie. What about animation? I make my animation with something like the following:

```julia
t_idx = Observable(1)

fig = Figure()
# some codes for plotting
surface!(ax, x, y, @lift(data[$t_idx]))
# some codes for plotting

if true
    record(fig, savename, timestamps; framerate=framerate, compression=1) do t
        t_idx[] = t
    end
end

```

Are there any options for `pt_per_unit` while saving the animation?

---

<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: [January 12, 2024, 11:28am UTC](https://discourse.julialang.org/t/setting-pt-per-unit-in-glmakie-for-animation/107063/2 "2024-01-12T11:28:19Z")

</div>

For GLMakie it should be `px_per_unit`!

---

<div class="post-metadata">

### Author: ![yhchang96](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yhchang96/32/36499_2.png) [@yhchang96](https://discourse.julialang.org/u/yhchang96)
#### Post date: [January 12, 2024, 1:52pm UTC](https://discourse.julialang.org/t/setting-pt-per-unit-in-glmakie-for-animation/107063/3 "2024-01-12T13:52:38Z")

</div>

but where do I enter this option? When saving a normal figure, we can just have `save(filename, fig; px_per_unit=10)`, but what about animation?

---

<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: [January 12, 2024, 2:27pm UTC](https://discourse.julialang.org/t/setting-pt-per-unit-in-glmakie-for-animation/107063/4 "2024-01-12T14:27:16Z")

</div>

To record!
