How to remove margin in single Makie plot

I would like to get rid of the surrounding white margin in the following Makie Plot.

Any Idea ?

using GLMakie

nx,ny = 500,500

fig = Figure(resolution = (nx, ny), fontsize = 22)
ax = Axis(fig[1, 1]; aspect = DataAspect())
x = LinRange(-1,1,100)
lines!(ax,x,x)
hidedecorations!(ax)
tightlimits!(ax)
resize_to_layout!(fig)
GLMakie.save(joinpath("toto.png"),fig)
fig

toto

That’s done with the figure_padding attribute Figures · Makie

1 Like

Perfect !
Thank you very much.

I did not see the “button to edit” the documentation but the word “margin” may be included in the text

You can change the amount of whitespace around the figure…

As

You can change the amount of whitespace around the figure (margin)…

In order to help a search in the search engine (I did not think to search for “padding”)

Anyway thank you again !