I want to create a graph with multiple axis and move them across the plot. I worked perfectly with Figure(), but do not work with GridLayout(), which I need to make combined figure.
How can I solve this problem?
How it should be:
How it is now:
The code before:
begin
times = range(-0.3, length=size(dat_e, 2), step=1 ./ 128)
f = Figure()
for i in 1:30
xmove = pos[i][1] *1000 - 120
ymove = pos[i][2] * 800 - 100
ax = Axis(f, bbox = BBox(xmove, xmove+90, ymove, ymove+30), title = string(raw.ch_names[i]))
mean_trial = mean(dat_e[i,:,:], dims=2)[:,1]
lines!(ax, times, mean_trial, color = "#0077b6") #, model = m4x4)
hlines!(0, color = :gray, linewidth = 1)
vlines!(0, color = :gray, linewidth = 1)
hidespines!(ax)
hidedecorations!(ax)
Makie.ylims!(low = -8, high = 14)
end
f
end
The code now:
function topo_array(f)
times = range(-0.3, length=size(dat_e, 2), step=1 ./ 128)
for i in 1:30
xmove = pos[i][1] *1000 - 120
ymove = pos[i][2] * 800 - 100
ax = Axis(f[1, 1], bbox = BBox(xmove, xmove+90, ymove, ymove+30), title = string(raw_ch_names[i]))
mean_trial = mean(dat_e[i,:,:], dims=2)[:,1]
lines!(ax, times, mean_trial, color = "#0077b6") #, model = m4x4)
hlines!(0, color = :gray, linewidth = 1)
vlines!(0, color = :gray, linewidth = 1)
hidespines!(ax)
hidedecorations!(ax)
Makie.ylims!(low = -8, high = 14)
end
f
end
topo_array(GridLayout())