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

Function make_logo

galleries/examples/misc/logos2.py:111–141  ·  view source on GitHub ↗

Create a full figure with the Matplotlib logo. Parameters ---------- height_px : int Height of the figure in pixel. lw_bars : float The linewidth of the bar border. lw_grid : float The linewidth of the grid. lw_border : float The linewidt

(height_px, lw_bars, lw_grid, lw_border, rgrid, with_text=False)

Source from the content-addressed store, hash-verified

109
110
111def make_logo(height_px, lw_bars, lw_grid, lw_border, rgrid, with_text=False):
112 """
113 Create a full figure with the Matplotlib logo.
114
115 Parameters
116 ----------
117 height_px : int
118 Height of the figure in pixel.
119 lw_bars : float
120 The linewidth of the bar border.
121 lw_grid : float
122 The linewidth of the grid.
123 lw_border : float
124 The linewidth of icon border.
125 rgrid : sequence of float
126 The radial grid positions.
127 with_text : bool
128 Whether to draw only the icon or to include 'matplotlib' as text.
129 """
130 dpi = 100
131 height = height_px / dpi
132 figsize = (5 * height, height) if with_text else (height, height)
133 fig = plt.figure(figsize=figsize, dpi=dpi)
134 fig.patch.set_alpha(0)
135
136 if with_text:
137 create_text_axes(fig, height_px)
138 ax_pos = (0.535, 0.12, .17, 0.75) if with_text else (0.03, 0.03, .94, .94)
139 ax = create_icon_axes(fig, ax_pos, lw_bars, lw_grid, lw_border, rgrid)
140
141 return fig, ax
142
143# %%
144# A large logo:

Callers 1

logos2.pyFile · 0.85

Calls 4

create_text_axesFunction · 0.85
create_icon_axesFunction · 0.85
figureMethod · 0.80
set_alphaMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…