@@ -516,14 +516,21 @@ def _get_layout(self, renderer):
516
516
517
517
def set_bbox (self , rectprops ):
518
518
"""
519
- Draw a bounding box around self.
519
+ Draw a box behind/around the text.
520
+
521
+ This can be used to set a background and/or a frame around the text.
522
+ It's realized through a `.FancyBboxPatch` behind the text (see also
523
+ `.Text.get_bbox_patch`). The bbox patch is None by default and only
524
+ created when needed.
520
525
521
526
Parameters
522
527
----------
523
- rectprops : dict with properties for `.patches. FancyBboxPatch`
528
+ rectprops : dict with properties for `.FancyBboxPatch` or None
524
529
The default boxstyle is 'square'. The mutation
525
530
scale of the `.patches.FancyBboxPatch` is set to the fontsize.
526
531
532
+ Pass ``None`` to remove the bbox patch completely.
533
+
527
534
Examples
528
535
--------
529
536
::
@@ -558,6 +565,8 @@ def get_bbox_patch(self):
558
565
"""
559
566
Return the bbox Patch, or None if the `.patches.FancyBboxPatch`
560
567
is not made.
568
+
569
+ For more details see `.Text.set_bbox`.
561
570
"""
562
571
return self ._bbox_patch
563
572
@@ -981,7 +990,10 @@ def get_window_extent(self, renderer=None, dpi=None):
981
990
982
991
def set_backgroundcolor (self , color ):
983
992
"""
984
- Set the background color of the text by updating the bbox.
993
+ Set the background color of the text.
994
+
995
+ This is realized through the bbox (see `.set_bbox`),
996
+ creating the bbox patch if needed.
985
997
986
998
Parameters
987
999
----------
0 commit comments