Makie: How to define subscenes and/or different plot windows

Something like this should work, but I consider it as very ugly - it’s one of the main reasons I haven’t officially published Makie yet :wink:

using Makie
AbstractPlotting.set_theme!()
x = collect(0:0.01:10); y = sin.(x)

scene = Scene(resolution=(1000,400))
area1 = lift(pixelarea(scene)) do a
    IRect(0, 0, widths(a) ./ Vec(2, 1))
end
area2 = lift(pixelarea(scene)) do a
    w, h = widths(a) ./ Vec(2, 1)
    IRect(w, 0, w, h)
end
subscene1 = Scene(scene, area1)
subscene2 = Scene(scene, area2)

lines!(subscene1, x, y)
lines!(subscene2, x, 2*y)

display(scene)

foreach(pixelarea(scene)) do area
    center!(subscene1) # need to center scene for each resize
    center!(subscene2)
end