I’d like to add background color to a text object in a Makie plot – fill the bounding box of the text with some color.
If I understood it correctly, text does not have a size property, so bb here has size zero:
t = text!(scene, "text")
bb = boundingbox(t)
Is there some way to accomplish this?
Background: I’m plotting circles with specific radii, and I want to add a text label on the edge of each circle with its radius. The problem is that the edge of the circle is visible through the text, and I’d like the text to obscure the edge of the circle behind it, all to improve readability. Kind of like:
For the sake of reactivity, it would be better to have the bbs depend on the text object so that if the user changes it too will change. Also, it might be simpler to wrap the text in a container where the first element is that scatter object, thus removing the need to reverse the order after the fact.
@sdanisch just discovered this doesn’t work with CairoMakie (regardless if the output is png or pdf). Which is really strange…
I’ll try with my scatter hack… OK, my scatter hack worked…