Mix 3d and 2d coordinates in Makie

Is it possible to mix 2d and 3d coordinates in Makie?

fig = Figure()
axis = Axis3(fig[1, 1])
scatter!(axis, 0, 0, 0)
# i want this one to be fixed in 2d
text!(axis, 0, 0, text = "look here")
# draw a line from the label, (0, 0) in 2d space to the point (0, 0, 0) in 3d space

By ā€œ2dā€ here, do you mean that you want the text to be in a fixed position on the screen? If so, try eg text(position; text, space = :relative) or :pixel. To draw a line to the text from a position in the scene is a bit more complex but you can use e.g. Makie.project(scene, text_position, :relative, :data) to get a position in data space that you can plot a line to in the scene.

1 Like