MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / set_backgroundcolor

Method set_backgroundcolor

lib/matplotlib/text.py:1093–1114  ·  view source on GitHub ↗

Set the background color of the text. This is realized through the bbox (see `.set_bbox`), creating the bbox patch if needed. Parameters ---------- color : :mpltype:`color` See Also -------- .set_bbox : To change the positio

(self, color)

Source from the content-addressed store, hash-verified

1091 return super().get_tightbbox(renderer)
1092
1093 def set_backgroundcolor(self, color):
1094 """
1095 Set the background color of the text.
1096
1097 This is realized through the bbox (see `.set_bbox`),
1098 creating the bbox patch if needed.
1099
1100 Parameters
1101 ----------
1102 color : :mpltype:`color`
1103
1104 See Also
1105 --------
1106 .set_bbox : To change the position of the bounding box
1107 """
1108 if self._bbox_patch is None:
1109 self.set_bbox(dict(facecolor=color, edgecolor=color))
1110 else:
1111 self._bbox_patch.update(dict(facecolor=color))
1112
1113 self._update_clip_properties()
1114 self.stale = True
1115
1116 def set_color(self, color):
1117 """

Callers

nothing calls this directly

Calls 3

set_bboxMethod · 0.95
updateMethod · 0.45

Tested by

no test coverage detected