# How to increase space between axes for topo array

**URL:** <https://discourse.julialang.org/t/how-to-increase-space-between-axes-for-topo-array/102568>\
**Category:** Visualization\
**Created:** [August 7, 2023, 3:00pm UTC](https://discourse.julialang.org/t/how-to-increase-space-between-axes-for-topo-array/102568 "2023-08-07T15:00:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vladdez](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vladdez/32/45806_2.png) [@vladdez](https://discourse.julialang.org/u/vladdez)\
**Post date:** [August 7, 2023, 3:00pm UTC](https://discourse.julialang.org/t/how-to-increase-space-between-axes-for-topo-array/102568/1 "2023-08-07T15:00:42Z")

</div>

I am creating topo array with this code:

```julia
using CairoMakie
using TopoPlots

function topo_array(f, times=nothing)
    f = Figure()
	times = nothing
    data, pos = TopoPlots.example_data()
	data = data[1:30,:,1]

    pos = hcat([[p[1], p[2]] for p in pos]...)
	pos = pos[:, 1:30]

    pos ./ maximum(pos, dims=2)
    axlist = []
    for (ix, p) in enumerate(eachcol(pos))
        x = p[1] #* 1.1
        y = p[2] #* 1.1
        # todo: 0.1 should go into plot config
        ax = Axis(f[1, 1], width=Relative(0.09), height=Relative(0.09), 
		halign=x, valign=y, title = string.(ix))
        # todo: add label if not nothing
		
        push!(axlist, ax)
    end
    # todo: make optional + be able to specify the linewidth + color
    hlines!.(axlist, Ref([0.0]), color=:gray, linewidth=0.5)
    vlines!.(axlist, Ref([0.0]), color=:gray, linewidth=0.5)

    times = isnothing(times) ? (1:size(data, 2)) : times

    # todo: add customizable kwargs
    h = lines!.(axlist, Ref(times), eachrow(data))

    linkaxes!(axlist...)
	hidedecorations!.(axlist)
	hidespines!.(axlist)
    
#	CairoMakie.trim!(f.layout)
    f
end

topo_array(Figure())

```

I got this picture:  
 ![image](https://global.discourse-cdn.com/julialang/original/3X/4/9/49884adc80d208f9ecebb67f2414a1124767bcee.png)

But how can I increase space between axes and avoid these white margins?  
I want smth like here:  
 ![image](https://global.discourse-cdn.com/julialang/original/3X/d/9/d91087d773024d1ed9f5b941cc42a261a4567e3c.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:** [August 8, 2023, 9:40am UTC](https://discourse.julialang.org/t/how-to-increase-space-between-axes-for-topo-array/102568/2 "2023-08-08T09:40:43Z")

</div>

Looks like your upper plot is the inner part of the lower plot that you want, just with fewer electrodes. The `valign` and `height` values etc. seem to have been handpicked for the lower version to work. With fewer electrodes, you get margins.
