# Fill a bounding box of a text in Makie

**URL:** <https://discourse.julialang.org/t/fill-a-bounding-box-of-a-text-in-makie/60640>\
**Category:** Visualization\
**Tags:** question, makie\
**Created:** [May 6, 2021, 10:47am UTC](https://discourse.julialang.org/t/fill-a-bounding-box-of-a-text-in-makie/60640 "2021-05-06T10:47:14Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![sdanisch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sdanisch/32/1406_2.png) [@sdanisch](https://discourse.julialang.org/u/sdanisch)\
**Post date:** [May 6, 2021, 11:12am UTC](https://discourse.julialang.org/t/fill-a-bounding-box-of-a-text-in-makie/60640/3 "2021-05-06T11:12:31Z")

</div>

This works:

```julia
using GLMakie
using GLMakie: Quaternionf0

positions = rand(Point2f0, 5)
fig, ax, textplot = text([(string(Tuple(round.(x, digits=2))), x) for x in positions], align=(:center, :center))

layouts = textplot._glyphlayout[]
strings = textplot[1][]
bbs = map(strings, layouts) do str, l 
    GLMakie.AbstractPlotting.data_text_boundingbox(str[1], l, Quaternionf0(0,0,0,1), Point3f0(0))
end
scatter!(ax, positions, markersize=widths.(bbs), marker=Rect)
reverse!(ax.scene.plots)
display(fig)

```

 ![image](https://global.discourse-cdn.com/julialang/original/3X/9/3/931331309e3d269c2740b50d618d6a8266548768.png)

---

_[View the full topic](https://discourse.julialang.org/t/fill-a-bounding-box-of-a-text-in-makie/60640)._
