Skip to content

Instantly share code, notes, and snippets.

@jkrumbiegel
Created January 16, 2026 21:38
Show Gist options
  • Select an option

  • Save jkrumbiegel/5dfe9c667a294b18492532cce3dfc8d5 to your computer and use it in GitHub Desktop.

Select an option

Save jkrumbiegel/5dfe9c667a294b18492532cce3dfc8d5 to your computer and use it in GitHub Desktop.
Image extending out of Makie Axis
using CairoMakie
img = Makie.loadasset("cow.png")
sz = reverse(size(img))
f = Figure()
for i in 1:3, j in 1:3
Axis(f[i, j])
end
ax = content(f[2, 2])
vp = ax.scene.viewport
bb = lift(vp) do vp
Rect2(vp.origin .- 0.5 * vp.widths, vp.widths * 2)
end
xs = @lift first.(extrema($bb))
ys = @lift last.(extrema($bb))
image!(f.scene, xs, ys, rotr90(img), alpha = 0.25)
image!(ax, 0..1, 0..1, rotr90(img))
limits!(ax, 0.25, 0.75, 0.25, 0.75)
f
@jkrumbiegel
Copy link
Author

grafik

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment