# Resizing a Figure with CairoMakie

**URL:** <https://discourse.julialang.org/t/resizing-a-figure-with-cairomakie/68691>\
**Category:** General Usage\
**Tags:** plotting, makie\
**Created:** [September 24, 2021, 10:54am UTC](https://discourse.julialang.org/t/resizing-a-figure-with-cairomakie/68691 "2021-09-24T10:54:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DNF](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dnf/32/10191_2.png) [@DNF](https://discourse.julialang.org/u/DNF)\
**Post date:** [September 24, 2021, 10:54am UTC](https://discourse.julialang.org/t/resizing-a-figure-with-cairomakie/68691/1 "2021-09-24T10:54:41Z")

</div>

I am using CairoMakie, and I need a plot window which contains many subaxes. The number can change from time to time, and it is very hard to determine in advance the correct size and resolution for the `Figure` that holds this.

Is there any way I can resize my figure _after_ finishing the plotting?

```julia
using CairoMakie
fig = Figure()
for i in 1:6
    ax = Axis(fig[i, 1]; aspect=DataAspect())
    heatmap!(ax, rand(10,10))
    ax = Axis(fig[i, 2]; aspect=DataAspect())
    heatmap!(ax, rand(10,10))
end
display(fig)

```

 ![badlayout](https://global.discourse-cdn.com/julialang/original/3X/6/9/69d59d49bd866e1aaadf61cfea957f0aca068dc8.png)

---

<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:** [September 24, 2021, 12:12pm UTC](https://discourse.julialang.org/t/resizing-a-figure-with-cairomakie/68691/2 "2021-09-24T12:12:46Z")

</div>

If `resize!(fig, resolution)` doesn’t work, `resize!(fig.scene, resolution)` should

---

<div class="post-metadata">

**Author:** ![DNF](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dnf/32/10191_2.png) [@DNF](https://discourse.julialang.org/u/DNF)\
**Post date:** [September 24, 2021, 12:27pm UTC](https://discourse.julialang.org/t/resizing-a-figure-with-cairomakie/68691/3 "2021-09-24T12:27:16Z")

</div>

Excellent! `resize!(fig.scene, resolution)` worked. Thanks!
