Sorry, I thought the code above was clear enough to guess the rest of the variables.
Here is the state of my packages:
(@v1.6) pkg> st GLMakie
Status `~\.julia\environments\v1.6\Project.toml`
[e9467ef8] GLMakie v0.1.27
(@v1.6) pkg> st Colors
Status `~\.julia\environments\v1.6\Project.toml`
[5ae59095] Colors v0.12.6
And here is a full MWE:
Summary
# Load packages
using GLMakie, Colors
# Data
freqs = range(5e8, 4.5e10, length = 1001);
lr = range(0.01, 2π, length = 1001);
S = Array{Complex,3}(undef, 1001, 3, 25);
for i = 1:25
S[:,1,i] = @. (50 - 50*exp(im*lr*i/12))/(50 + 50*exp(im*lr*i/12))
S[:,2,i] = @. (50 - 75*exp(im*lr*i/12))/(50 + 75*exp(im*lr*i/12))
S[:,3,i] = @. (50 - 35*exp(im*lr*i/12))/(50 + 35*exp(im*lr*i/12))
end
# Figure
titles = ["S₁₁","S₁₂","S₂₂"]
res = (1920*0.9, 1080*0.5) # Pixel size
fig = Figure(resolution = res)
for i = 1:3
fig[1,i] = Axis(fig,
title = titles[i],
xminorticksvisible = true,
yminorticksvisible = true,
xminorgridvisible = true,
yminorgridvisible = true,
xminorticks = IntervalsBetween(4),
yminorticks = IntervalsBetween(4),
xlabel = "f [GHz]",
ylabel = "dB")
end
linkaxes!(contents(fig[1,1])[1], contents(fig[1,2])[1], contents(fig[1,3])[1])
ylims!(contents(fig[1,1])[1], (-50, 0))
fig[0,:] = Label(fig, "Default title", textsize = 30)
# Interactivity
fig[3,:] = Slider(fig, range = 1:25, startvalue = 1)
p = contents(fig[3,:])[1].value
toggle = Toggle(fig, active = true)
# Create labels (static)
lin_label = Label(fig, "lin")
dB_label = Label(fig, "dB")
# Display labels and toggle
fig[2,4] = grid!(hcat(lin_label,toggle,dB_label), tellheight = false)
# Try to plot figures
labels = ["CST","CST","CST"]
colores = [RGB(0.85, 0.325, 0.098), RGB(0, 0.447, 0.741)]
indices = [CartesianIndex(1,1),CartesianIndex(1,2),CartesianIndex(2,2)]
dB = x -> (20*log10(abs(x)))
for i in 1:3
lines!(fig[2,i],
freqs,
dB.(S[:,i,1]),
label = labels[i],
ylabel = "dB",
color = colores)
end