The following works more or less. But, it will be better to actually save the scene with all the spines and ticks values, plus the window is closing when I hit the button save. Any suggestions?
using GLMakie
with_theme(theme_minimal()) do
fig = Figure()
menu = Menu(fig, options = ["save to file"])
menu2 = Menu(fig, options = ["Spectral_11", "viridis", "heat"])
ax = Axis(fig[1, 1])
toggles = [Toggle(fig, active = active) for active in [true, false]]
labels = [Label(fig, lift(x -> x ? "$l visible" : "$l invisible", t.active))
for (t, l) in zip(toggles, ["sine", "cosine"])]
fig[1, 2] = grid!(hcat(toggles, labels), tellheight = false)
line1 = lines!(0..10, sin, color = :blue, visible = false)
line2 = lines!(0..10, cos, color = :red)
pltobj = heatmap!(1:3, 0:0.1:0.5, rand(3,5))
fig[1, 0] = vgrid!(
Label(fig, "Save ?", width = nothing), menu,
Label(fig, "colormap", width = nothing), menu2; tellheight = false, width = 200)
on(menu.selection) do s
save("testFile.png", ax.scene, resolution = (1900,800)) # not good, axis are gone
end
on(menu2.selection) do s
pltobj.colormap = s
end
connect!(line1.visible, toggles[1].active)
connect!(line2.visible, toggles[2].active)
fig
end