|
35 | 35 | _pop_kwargs, |
36 | 36 | _pop_params, |
37 | 37 | _pop_props, |
| 38 | + _snippet_manager, |
38 | 39 | _version_mpl, |
39 | 40 | docstring, |
40 | 41 | rcsetup, |
|
64 | 65 | `~matplotlib.axes.Axes.transAxes`, or `~matplotlib.figure.Figure.transFigure` |
65 | 66 | transforms. Default is ``'axes'``, i.e. `bounds` is in axes-relative coordinates. |
66 | 67 | """ |
67 | | -docstring.snippets['axes.transform'] = _transform_docstring |
| 68 | +_snippet_manager['axes.transform'] = _transform_docstring |
68 | 69 |
|
69 | 70 |
|
70 | 71 | # Projection docstring |
|
89 | 90 | Whether to use `~mpl_toolkits.basemap.Basemap` or `~cartopy.crs.Projection` |
90 | 91 | for map projections. Default is :rc:`basemap`. |
91 | 92 | """ |
92 | | -docstring.snippets['axes.proj'] = _proj_docstring |
93 | | -docstring.snippets['axes.proj_kw'] = _proj_kw_docstring |
94 | | -docstring.snippets['axes.basemap'] = _basemap_docstring |
| 93 | +_snippet_manager['axes.proj'] = _proj_docstring |
| 94 | +_snippet_manager['axes.proj_kw'] = _proj_kw_docstring |
| 95 | +_snippet_manager['axes.basemap'] = _basemap_docstring |
95 | 96 |
|
96 | 97 |
|
97 | 98 | # Inset docstring |
|
125 | 126 | **kwargs |
126 | 127 | Passed to `CartesianAxes`. |
127 | 128 | """ |
128 | | -docstring.snippets['axes.inset'] = docstring.add_snippets(_inset_docstring) |
| 129 | +_snippet_manager['axes.inset'] = _inset_docstring |
129 | 130 |
|
130 | 131 |
|
131 | 132 | # Panel docstring |
|
168 | 169 | `~proplot.axes.CartesianAxes` |
169 | 170 | The panel axes. |
170 | 171 | """ |
171 | | -docstring.snippets['axes.panel'] = docstring.add_snippets(_panel_docstring) |
| 172 | +_snippet_manager['axes.panel'] = _panel_docstring |
172 | 173 |
|
173 | 174 |
|
174 | 175 | # Colorbar and legend space |
|
191 | 192 | *inset* {name}, the old {name} is removed. If ``False`` and `loc` is an |
192 | 193 | *outer* {name}, the {name}s are stacked. |
193 | 194 | """ |
194 | | -docstring.snippets['axes.legend_space'] = docstring.add_snippets( |
195 | | - _space_docstring.format(name='legend', default='legend.borderaxespad') |
| 195 | +_snippet_manager['axes.legend_space'] = _space_docstring.format( |
| 196 | + name='legend', default='legend.borderaxespad' |
196 | 197 | ) |
197 | | -docstring.snippets['axes.colorbar_space'] = docstring.add_snippets( |
198 | | - _space_docstring.format(name='colorbar', default='colorbar.insetpad') |
| 198 | +_snippet_manager['axes.colorbar_space'] = _space_docstring.format( |
| 199 | + name='colorbar', default='colorbar.insetpad' |
199 | 200 | ) |
200 | 201 |
|
201 | 202 |
|
|
302 | 303 | Many of the keyword arguments documented above are actually applied by updating |
303 | 304 | the `~proplot.config.rc` settings then retrieving the updated settings. |
304 | 305 | """ |
305 | | -docstring.snippets['axes.rc'] = _rc_format_docstring |
306 | | -docstring.snippets['axes.format'] = _axes_format_docstring |
307 | | -docstring.snippets['figure.format'] = _figure_format_docstring |
| 306 | +_snippet_manager['axes.rc'] = _rc_format_docstring |
| 307 | +_snippet_manager['axes.format'] = _axes_format_docstring |
| 308 | +_snippet_manager['figure.format'] = _figure_format_docstring |
308 | 309 |
|
309 | 310 |
|
310 | 311 | # Colorbar docstrings |
|
344 | 345 | mappable object. If the attribute is unavailable, we use ``'neither'``. |
345 | 346 | extendsize : float or str, optional |
346 | 347 | The length of the colorbar "extensions" in physical units. Default is |
347 | | - :rc:`colorbar.insetextend` for inset colorbars and :rc:`colorbar.extend` |
348 | | - for outer colorbars. %(units.em)s |
| 348 | + :rc:`colorbar.insetextend` for inset colorbars and :rc:`colorbar.extend` for |
| 349 | + outer colorbars. %(units.em)s |
349 | 350 | frame, frameon : bool, optional |
350 | 351 | For inset colorbars only. Indicates whether to draw a "frame", just |
351 | 352 | like `~matplotlib.axes.Axes.legend`. Default is :rc:`colorbar.frameon`. |
|
411 | 412 | **kwargs |
412 | 413 | Passed to `~matplotlib.figure.Figure.colorbar`. |
413 | 414 | """ |
414 | | -docstring.snippets['axes.colorbar_args'] = _colorbar_args_docstring |
415 | | -docstring.snippets['axes.colorbar_kwargs'] = _colorbar_kwargs_docstring |
| 415 | +_snippet_manager['axes.colorbar_args'] = _colorbar_args_docstring |
| 416 | +_snippet_manager['axes.colorbar_kwargs'] = _colorbar_kwargs_docstring |
416 | 417 |
|
417 | 418 |
|
418 | 419 | # Legend docstrings |
|
476 | 477 | **kwargs |
477 | 478 | Passed to `~matplotlib.axes.Axes.legend`. |
478 | 479 | """ |
479 | | -docstring.snippets['axes.legend_args'] = _legend_args_docstring |
480 | | -docstring.snippets['axes.legend_kwargs'] = _legend_kwargs_docstring |
| 480 | +_snippet_manager['axes.legend_args'] = _legend_args_docstring |
| 481 | +_snippet_manager['axes.legend_kwargs'] = _legend_kwargs_docstring |
481 | 482 |
|
482 | 483 |
|
483 | 484 | class Axes(maxes.Axes): |
@@ -1234,8 +1235,8 @@ def _update_super_labels(self, side, labels=None, **kwargs): |
1234 | 1235 | if labels or kw: |
1235 | 1236 | fig._update_super_labels(side, labels, **kw) |
1236 | 1237 |
|
1237 | | - @docstring.obfuscate_signature |
1238 | | - @docstring.add_snippets |
| 1238 | + @docstring._obfuscate_signature |
| 1239 | + @_snippet_manager |
1239 | 1240 | def format( |
1240 | 1241 | self, *, title=None, title_kw=None, abc_kw=None, |
1241 | 1242 | ltitle=None, lefttitle=None, |
@@ -1378,14 +1379,14 @@ def get_tightbbox(self, renderer, *args, **kwargs): |
1378 | 1379 | self._tight_bbox = bbox |
1379 | 1380 | return bbox |
1380 | 1381 |
|
1381 | | - @docstring.add_snippets |
| 1382 | + @_snippet_manager |
1382 | 1383 | def inset(self, *args, **kwargs): |
1383 | 1384 | """ |
1384 | 1385 | %(axes.inset)s |
1385 | 1386 | """ |
1386 | 1387 | return self.inset_axes(*args, **kwargs) |
1387 | 1388 |
|
1388 | | - @docstring.add_snippets |
| 1389 | + @_snippet_manager |
1389 | 1390 | def inset_axes( |
1390 | 1391 | self, bounds, transform=None, *, proj=None, projection=None, |
1391 | 1392 | zoom=None, zoom_kw=None, zorder=4, **kwargs |
@@ -1486,14 +1487,14 @@ def indicate_inset_zoom(self, **kwargs): |
1486 | 1487 | self._inset_zoom_data = (rectpatch, connects) |
1487 | 1488 | return rectpatch, connects |
1488 | 1489 |
|
1489 | | - @docstring.add_snippets |
| 1490 | + @_snippet_manager |
1490 | 1491 | def panel(self, *args, **kwargs): |
1491 | 1492 | """ |
1492 | 1493 | %(axes.panel)s |
1493 | 1494 | """ |
1494 | 1495 | return self.panel_axes(*args, **kwargs) |
1495 | 1496 |
|
1496 | | - @docstring.add_snippets |
| 1497 | + @_snippet_manager |
1497 | 1498 | def panel_axes(self, *args, **kwargs): |
1498 | 1499 | """ |
1499 | 1500 | %(axes.panel)s |
@@ -2187,8 +2188,8 @@ def _draw_colorbar( |
2187 | 2188 | self._add_guide('colorbar', obj, loc) # possibly replace another |
2188 | 2189 | return obj |
2189 | 2190 |
|
2190 | | - @docstring.obfuscate_signature |
2191 | | - @docstring.add_snippets |
| 2191 | + @docstring._obfuscate_signature |
| 2192 | + @_snippet_manager |
2192 | 2193 | def colorbar( |
2193 | 2194 | self, mappable, values=None, *, loc=None, location=None, queue=False, |
2194 | 2195 | **kwargs |
@@ -2701,8 +2702,8 @@ def _draw_legend( |
2701 | 2702 | self._add_guide('legend', obj, loc) # possibly replace another |
2702 | 2703 | return obj |
2703 | 2704 |
|
2704 | | - @docstring.concatenate_original |
2705 | | - @docstring.add_snippets |
| 2705 | + @docstring._concatenate_original |
| 2706 | + @_snippet_manager |
2706 | 2707 | def legend( |
2707 | 2708 | self, handles=None, labels=None, *, loc=None, location=None, queue=False, |
2708 | 2709 | **kwargs |
@@ -2838,7 +2839,8 @@ def _update_text(text, props=None, **kwargs): |
2838 | 2839 |
|
2839 | 2840 | return mtext.Text.update(text, props) |
2840 | 2841 |
|
2841 | | - @docstring.concatenate_original |
| 2842 | + @docstring._concatenate_original |
| 2843 | + @_snippet_manager |
2842 | 2844 | def text( |
2843 | 2845 | self, *args, |
2844 | 2846 | border=False, bordercolor='w', borderwidth=2, borderinvert=False, |
@@ -2883,15 +2885,17 @@ def text( |
2883 | 2885 | The alpha for the bounding box. Default is ``'0.5'``. |
2884 | 2886 | bboxpad : float, optional |
2885 | 2887 | The padding for the bounding box. Default is :rc:`title.bboxpad`. |
2886 | | - family, fontfamily, name, fontname : str, optional |
2887 | | - The font name (e.g., ``'Fira Math'``) or font family name (e.g., |
| 2888 | + name, fontname |
| 2889 | + Aliases for `family`, `fontfamily`. |
| 2890 | + family, fontfamily : str, optional |
| 2891 | + The font typeface name (e.g., ``'Fira Math'``) or font family name (e.g., |
2888 | 2892 | ``'serif'``). Matplotlib falls back to the system default if not found. |
2889 | 2893 | size, fontsize : float or str, optional |
2890 | 2894 | The font size. %(units.pt)s |
2891 | 2895 | This can also be a string indicating some scaling relative to |
2892 | | - :rcraw:`font.size`. The sizes and scalings are shown below. |
2893 | | - ``'med-small'`` and ``'med-large'`` are added by ProPlot |
2894 | | - while the rest are native matplotlib sizes. |
| 2896 | + :rcraw:`font.size`. The sizes and scalings are shown below. The |
| 2897 | + scalings ``'med'``, ``'med-small'``, and ``'med-large'`` are |
| 2898 | + added by ProPlot while the rest are native matplotlib sizes. |
2895 | 2899 |
|
2896 | 2900 | .. _font_table: |
2897 | 2901 |
|
|
0 commit comments