# How to remove margin in single Makie plot

**URL:** https://discourse.julialang.org/t/how-to-remove-margin-in-single-makie-plot/98169
**Category:** General Usage
**Tags:** plotting, makie
**Created:** [May 1, 2023, 5:30pm UTC](https://discourse.julialang.org/t/how-to-remove-margin-in-single-makie-plot/98169 "2023-05-01T17:30:20Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![LaurentPlagne](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/laurentplagne/32/10103_2.png) [@LaurentPlagne](https://discourse.julialang.org/u/LaurentPlagne)
#### Post date: [May 1, 2023, 5:30pm UTC](https://discourse.julialang.org/t/how-to-remove-margin-in-single-makie-plot/98169/1 "2023-05-01T17:30:20Z")

</div>

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

Any Idea ?

```julia
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](https://global.discourse-cdn.com/julialang/original/3X/2/f/2f3c4cb6fea6e39da06fda6053b7a63ad0e6d2e1.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: [May 1, 2023, 6:00pm UTC](https://discourse.julialang.org/t/how-to-remove-margin-in-single-makie-plot/98169/2 "2023-05-01T18:00:02Z")

</div>

That’s done with the `figure_padding` attribute [Figures · Makie](https://docs.makie.org/stable/documentation/figure/#figure_padding)

---

<div class="post-metadata">

### Author: ![LaurentPlagne](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/laurentplagne/32/10103_2.png) [@LaurentPlagne](https://discourse.julialang.org/u/LaurentPlagne)
#### Post date: [May 1, 2023, 6:17pm UTC](https://discourse.julialang.org/t/how-to-remove-margin-in-single-makie-plot/98169/3 "2023-05-01T18:17:53Z")

</div>

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 !
