Skip to content

Instantly share code, notes, and snippets.

@jkrumbiegel
Created July 8, 2022 16:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jkrumbiegel/6716cffad666589d8b948258867ebe40 to your computer and use it in GitHub Desktop.
Save jkrumbiegel/6716cffad666589d8b948258867ebe40 to your computer and use it in GitHub Desktop.
f = Figure()
ax = Axis(f[1, 1])
ax2 = Axis(f[1, 1], width = Relative(0.3), height = Relative(0.3), valign = 0.8, halign = 0.8)
p = Point(1, 1)
scatter!(ax, p, markersize = 15)
limits!(ax, 0, 10, 0, 10)
points = lift(ax.scene.px_area, ax.scene.camera.projectionview, ax2.scene.px_area) do pxa, pv, pxa2
p1 = Makie.bottomright(pxa2) - pxa.origin
p2 = Makie.topleft(pxa2) - pxa.origin
p3 = Makie.project(ax.scene, p)
Point2f[p1, p3, p2]
end
lines!(ax, points, linestyle = :dash, space = :pixel)
f
@jkrumbiegel
Copy link
Author

image

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