Makie: how to add some gap to the right end of a figure?

I have a figure that is composed of two columns. Each column is itself a GridLayout. I am having the problem that on the right end of the figure, the axes labels go over the figure boundary:

image

How do I fix this? I don’t want to change the figure padding, because the left side is fine. I tried

colgap!(fig.layout, 2, 10.0)

but this doesn’t work as the figure has only 1 gap.

You can set figure padding to be different for each side:

fig = Figure(figure_padding = (10.0, 0.0, 100.0, 50.0)) #(L, R, B, T)
ax = Axis(fig[1,1])
fig

Thanks! What’s the way to change the figure padding after the figure has been created and all elements are plotted?

@Datseris How did you get the background for the (a), (b), (c) labels?

I use the label_axes! function with keyword add_box = true

The figure_padding goes into the alignmode = Outside(...) of the parent layout, so you can change it there via fig.layout.alignmode = Outside(l, r, b, t).

More targeted, you could also set ax.alignmode = Mixed(right = Makie.Protrusion(some_value)) only on the axis with the labels hanging out, this would instruct the layout to use a larger protrusion value on the right (it’s zero usually, as the x labels are not included in it for reasons)