MCPcopy Index your code
hub / github.com/matplotlib/cheatsheets / text

Function text

scripts/legend.py:33–41  ·  view source on GitHub ↗
(x, y, _text)

Source from the content-addressed store, hash-verified

31
32
33def text(x, y, _text):
34 color= "C1"
35 if not 0 < x < 1 or not 0 < y < 1: color = "C0"
36 size = 0.15
37 ax.text(x, y, _text, color="white", # bbox={"color": "C1"},
38 size="xx-large", weight="bold", ha="center", va="center")
39 rect = plt.Rectangle((x-size/2, y-size/2), size, size, facecolor=color,
40 zorder=-10, clip_on=False)
41 ax.add_patch(rect)
42
43
44def point(x, y):

Callers 1

legend.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected