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

Function draw_text

galleries/examples/axes_grid1/simple_anchored_artists.py:15–33  ·  view source on GitHub ↗

Draw two text-boxes, anchored by different corners to the upper-left corner of the figure.

(ax)

Source from the content-addressed store, hash-verified

13
14
15def draw_text(ax):
16 """
17 Draw two text-boxes, anchored by different corners to the upper-left
18 corner of the figure.
19 """
20 from matplotlib.offsetbox import AnchoredText
21 at = AnchoredText("Figure 1a",
22 loc='upper left', prop=dict(size=8), frameon=True,
23 )
24 at.patch.set_boxstyle("round,pad=0.,rounding_size=0.2")
25 ax.add_artist(at)
26
27 at2 = AnchoredText("Figure 1(b)",
28 loc='lower left', prop=dict(size=8), frameon=True,
29 bbox_to_anchor=(0., 1.),
30 bbox_transform=ax.transAxes
31 )
32 at2.patch.set_boxstyle("round,pad=0.,rounding_size=0.2")
33 ax.add_artist(at2)
34
35
36def draw_circle(ax):

Callers 1

Calls 3

AnchoredTextClass · 0.90
set_boxstyleMethod · 0.80
add_artistMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…