Increase margin of combined plot made out of subplots with Plots.jl

Fourier
Mon, 26 Jan 2026 09:12:06 +0000
Visualization

I am plotting multiple plots in a combined plot like this:

using Plots
using Plots.Measures: mm

plots = Vector{Any}()
for (i,j) in Iterators.product(1:4, 1:4)
    p = scatter(rand(100), xlabel="X-axis $i,$j", ylabel="Y-axis $i,$j", title="Plot $i,$j")
    push!(plots, p)
end
plot(plots..., layout=(4,4), size = (2480, 3508) .÷ 4)

However as can be seen the labels for the axes are cut off.

Therefore I would like to increase the margin on the left.

However when I use the margins keyword (or similar) like this:

plot(plots..., layout=(4,4),size = (2480, 3508) .÷ 4, left_margin=15mm, bottom_margin=15mm)

it will increase the margin of all subplots:

I actually intend to change the margin of the total, outside plot. So how could I fix this?

3 posts - 2 participants