Open kockahonza opened 2 weeks ago
Ah yes, the problem is the following: the text plot is drawn before the scatter plot, because the scatter plot markersize depends on the glyph size of the ilabels. Since the node plot is defined later, its markers would overdraw the labels. To circumvent this, we translate the ilabels plot +1 in z direction
which is essentially taken from the docs. Not a problem in 2d but quite the problem in 3d... So we need a better way of reordering the plots without actually touching the z coordinate.
Hmm, maybe define a depth_shift? But that might not work in Cairo...would have to investigate. FerriteViz.jl does this.
depth_shift
does not seem to affect different 2d billboards within the same plane, see below example... maybe its possible to reorder the the plots array at the end of the recipe?
using Pkg
pkg"activate --temp"
pkg"add GLMakie"
using GLMakie
pos = Point3{Float32}[(0,0,0),(1,0,0),(0,1,0),(0,0,1)]
labels = ["o", "x", "y", "z"]
fig = Figure()
ax = LScene(fig[1,1])
text!(ax, pos; text=labels, align=(:center,:center), depth_shift=1)
scatter!(ax, pos; markersize=50, depth_shift=-1)
Pretty much as the title says, when I try to use ilabels in 3D layouts the graph works and I do get labels but they're seemingly all offset by a large amount in the z direction. Maybe I'm just not using something correctly but it at least looks like a bug, I'm attaching an image with the resulting plot.