You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using GLMakie
fig, ax, p =text([(0,0),(0,1)]; text=["foo", "bar"])
glyphcollections = p.plots[1][1][]
boundingbox(glyphcollections[1], Quaternion((1,0,0,0))) # bouding box of text "foo"boundingbox(glyphcollections[2], Quaternion((1,0,0,0))) # bouding box of text "bar"
to get the the bounding box of single elements within a textplot to draw node shapes around it in the correct size.
This solution (...which admittedly abused internals...) does not work anymore in Makie@0.21. Any suggestions on how to replace it?
boundingbox(plot, plot.markerspace[]) will give you a bounding box for the text plot with positions included, and string_boundingbox(glyph_collection, pos, rot) = unchecked_boundingbox(glyph_collection, pos, rot) will give you one without if you set pos = Point3d(0). The former is public, the latter still internal.
Thank you! For now unchecked_boundingbox is a working replacement. Of course it would be nice to go to the documented API. boundingbox(plot, plot.markerspace[]) will still give me a bounding box for the entire text plot. What I need specifically is the bounding box for each individual label. Am I missing something?
In GraphMakie on Makie@0.20 we used to use
to get the the bounding box of single elements within a textplot to draw node shapes around it in the correct size.
This solution (...which admittedly abused internals...) does not work anymore in Makie@0.21. Any suggestions on how to replace it?
xref MakieOrg/GraphMakie.jl#183
The text was updated successfully, but these errors were encountered: