GLMakie -- text versus annotation -- annotation not working?

Hi,

Note that in the documentation example, points is a Vector{Tuple{Float64, Float64}}, while you’re supplying a Matrix. If you also use that here, via

annotation!(ax2, Tuple.(eachrow(pts)), text = lbs)

everything works fine.


In general it’s often unclear to me when Makie will accept a Matrix (normally you’d use 2 \times n though), but in my experience, a Vector{Point2f} (or Vector{Point3f} in 3D) never gives any issues and is more descriptive than a Matrix. So when in doubt, I’d advise to use that.

annotation!(ax2, Point2f.(eachrow(pts)), text = lbs)
2 Likes