Makie inset fully "on top"

Similar to this question. I’m drawing a figure that has a main axis and an inset (a zoom). How would I go about to have the whole inset with a background, effectively blocking out the underlying main figure?

Using a gray background in the Axis for the inset and using translate!(inset.blockscene, 0, 0, 100) gives me the figure below. The grid lines of the main plot are indeed blocked by the gray background of the inset Axis. However, I would also like to have the ticks and labels of the inset Axis with the same grey background and also blocking out the underlying graph (lines and gridlines).

f = Figure()
Axis(f[1, 1])
scatter!(cumsum(randn(1000)))

inset_gl = GridLayout(f[1, 1], height = Relative(0.5), width = Relative(0.5))
b = Box(inset_gl[1, 1], color = :gray80)
translate!(b.blockscene, 0, 0, 100)
inset = Axis(inset_gl[1, 1], alignmode = Outside(15))
translate!(inset.blockscene, 0, 0, 200)
f

Thanks! But for the next level, what if my inset has a double y-axis?

I’m seeing this when I add a second vertical axis using the information on creating a twin axis. It seems the second Axis is shifted left and down.

Code snippet


<your code>
      inset2 = Axis(inset_gl[1, 1],
        limits=(tz1, tz2, v2low, v2high),
        ylabel=v2label,
        yticks=LinearTicks(v2zoomticks),
        ytickformat="{:.$(v2digits)f}",
        yaxisposition=:right,
        alignmode=Outside(15),
      )

      hidespines!(inset2)
      hidexdecorations!(inset2)

      lines!(inset2, t, v2)