Tested with GR and Plotly.
This:
p1 = spy(randn(100,100), legend=false)
p2 = plot(randn(50))
plot(p1, p2, xlink=true, layout=(2,1))
Produces this:

spy with heatmap, all is well. yflip=true to heatmap, I get the above behavior. I haven't had time to dig deeper yet, but it looks like yflip is the culprit.xflip = true, but breaking something is to be expected there.I think the issue is that the spy recipe sets aspect_ratio := 1
We could replace that with aspect_ratio --> 1 and then you could do plot(p1, p2, xlink=true, layout=(2,1), aspect_ratio = :auto), which should give the same as replacing spy with heatmap and adding yflip = true in your code.
EDIT: plot(p1, p2, xlink=true, layout=(2,1), aspect_ratio = :none)
In principle, I guess aspect_ratio shouldn't break xlink?
I'm not sure I follow. Do you mean plot(p1, p2, xlink=true, layout=(2,1)) should natively give a plot with a big square spy subplot above a smaller (not as high) line plot?
Yes, don't you?
That would be the nicest default behaviour, but that's probably not that easy to achieve. I've never really looked that much into the layout code ...
Most helpful comment
I'm not sure I follow. Do you mean
plot(p1, p2, xlink=true, layout=(2,1))should natively give a plot with a big square spy subplot above a smaller (not as high) line plot?