Created
January 16, 2026 21:38
-
-
Save jkrumbiegel/5dfe9c667a294b18492532cce3dfc8d5 to your computer and use it in GitHub Desktop.
Image extending out of Makie Axis
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
Author
jkrumbiegel
commented
Jan 16, 2026
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment