# How to increase the vertical gap between subplots in Plots.jl

**URL:** <https://discourse.julialang.org/t/how-to-increase-the-vertical-gap-between-subplots-in-plots-jl/85990>\
**Category:** Visualization\
**Created:** [August 19, 2022, 8:48am UTC](https://discourse.julialang.org/t/how-to-increase-the-vertical-gap-between-subplots-in-plots-jl/85990 "2022-08-19T08:48:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Firstname\_Lastname](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/firstname_lastname/32/34201_2.png) [@Firstname\_Lastname](https://discourse.julialang.org/u/Firstname_Lastname)\
**Post date:** [August 19, 2022, 8:48am UTC](https://discourse.julialang.org/t/how-to-increase-the-vertical-gap-between-subplots-in-plots-jl/85990/1 "2022-08-19T08:48:51Z")

</div>

I have four subplots

```julia
using MonteCarloMeasurements, Plots

x = LinRange(1:0.1:3)
a = 1 \pm 0.1
b = 2 \pm 0.3

f(x) = a*x + b

fig1 = plot(x, f.(x))
fig2 = plot(x, f.(x))
fig3 = plot(x, f.(x))
fig4 = plot(x, f.(x))

```

They are arranged in a layout of 2 by 2

```julia
plot(fig1, fig2, fig3, fig4, layout=(2,2)) 

```

I notice the vertical distance between subplots is small. How can I increase this distance?

Thank you.

---

<div class="post-metadata">

**Author:** ![baggepinnen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/baggepinnen/32/693_2.png) [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)\
**Post date:** [August 19, 2022, 9:53am UTC](https://discourse.julialang.org/t/how-to-increase-the-vertical-gap-between-subplots-in-plots-jl/85990/2 "2022-08-19T09:53:32Z")

</div>

Use the `margin` keyword with a length in `mm`, accessible as `Plots.mm`

```julia
plot(randn(10,4), layout=4, margin=10*Plots.mm)

```

---

<div class="post-metadata">

**Author:** ![Firstname\_Lastname](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/firstname_lastname/32/34201_2.png) [@Firstname\_Lastname](https://discourse.julialang.org/u/Firstname_Lastname)\
**Post date:** [August 19, 2022, 10:11am UTC](https://discourse.julialang.org/t/how-to-increase-the-vertical-gap-between-subplots-in-plots-jl/85990/3 "2022-08-19T10:11:13Z")

</div>

Thank you for your help.
