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

Function create_text_axes

galleries/examples/misc/logos2.py:93–108  ·  view source on GitHub ↗

Create an Axes in *fig* that contains 'matplotlib' as Text.

(fig, height_px)

Source from the content-addressed store, hash-verified

91
92
93def create_text_axes(fig, height_px):
94 """Create an Axes in *fig* that contains 'matplotlib' as Text."""
95 ax = fig.add_axes((0, 0, 1, 1))
96 ax.set_aspect("equal")
97 ax.set_axis_off()
98
99 path = TextPath((0, 0), "matplotlib", size=height_px * 0.8,
100 prop=get_font_properties())
101
102 angle = 4.25 # degrees
103 trans = mtrans.Affine2D().skew_deg(angle, 0)
104
105 patch = PathPatch(path, transform=trans + ax.transData, color=MPL_BLUE,
106 lw=0)
107 ax.add_patch(patch)
108 ax.autoscale()
109
110
111def make_logo(height_px, lw_bars, lw_grid, lw_border, rgrid, with_text=False):

Callers 1

make_logoFunction · 0.85

Calls 9

TextPathClass · 0.90
PathPatchClass · 0.90
get_font_propertiesFunction · 0.85
add_axesMethod · 0.80
skew_degMethod · 0.80
add_patchMethod · 0.80
set_aspectMethod · 0.45
set_axis_offMethod · 0.45
autoscaleMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…