# Revision history [back]

### How to fill rectangle around the text (or measure string)?

Hello!

I would like to fill a rectangle around the text on the plot, to make text more readable (same way it is done for the legend), the perfect way would be:

text('Sage!', (0, 0), fill=True, fill_color='blue', edgecolor='black')


But unfortunately there are no such options. I tried to write a custom function using text and polygon2d, but the problem appeared in calculating the size of the rectangle around the arbitrary text.

So, could anyone help me figure out how to calculate the size of the rectangle around the text (something like string measuring with consideration of font settings?), or may be suggest a better approach?