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)
| 109 | |
| 110 | |
| 111 | def 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: |
no test coverage detected
searching dependent graphs…