Multiple page plots

Ok I see. Well you know the sizes of your figures, you can plot into the figure scene (which has a campixel camera, so no additional scaling) using those coordinates. You can draw a big arrow via poly with a polygon or a BezierPath and then add the same one twice, just adjusted for overall position in the “merged figure”.

Here I simulate this process by concatenating the images from four figures thought to be arranged in a square.

using CairoMakie
using LinearAlgebra

function arrowpoly(p1, p2, width)
    d = normalize(reverse(p2 - p1) .* (1, -1))
    [
        p1 + d * width/2,
        p2,
        p1 - d * width/2,
        p1 + d * width/2,
    ]
end

##

function makefig()
    fig = Figure(size = (500, 500), backgroundcolor = rand(RGBf))

    for i in 1:3, j in 1:3
        Axis(fig[i, j])
    end

    fig
end

# arrow starts at (100, 400) in top-left figure and ends in (300, 400) in bottom-right
p1 = Point2f(100, 400)
p2 = Point2f(300, 400)

f1 = makefig()
translate!(poly!(f1.scene, arrowpoly(p1, p2 + Point2f(500, -500), 50), color = :red), 0, 0, 100)

f2 = makefig()
translate!(poly!(f2.scene, arrowpoly(p1 + Point2f(-500, 0), p2 + Point2f(0, -500), 50), color = :red), 0, 0, 100)

f3 = makefig()
translate!(poly!(f3.scene, arrowpoly(p1 + Point2f(0, 500), p2 + Point2f(500, 0), 50), color = :red), 0, 0, 100)

f4 = makefig()
translate!(poly!(f4.scene, arrowpoly(p1 + Point2f(-500, 500), p2, 50), color = :red), 0, 0, 100)

save("test.png", ([
    colorbuffer(f1) colorbuffer(f2)
    colorbuffer(f3) colorbuffer(f4)
]))

I spent no effort on the arrow shape though :smiley:

3 Likes